File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 22# Find issues in O2 code
33name : O2 linter
44
5- # "on": [pull_request_target, push]
5+ " on " : [pull_request_target, push]
66permissions : {}
77env :
88 BRANCH_MAIN : master
@@ -20,12 +20,12 @@ jobs:
2020 steps :
2121 - name : Set branches
2222 run : |
23- if [[ "${{ github.event_name }}" == "push" ]]; then
23+ if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "pull_request" ]]; then
2424 branch_head="${{ github.ref }}"
25- branch_base="${{ env.BRANCH_MAIN }}"
25+ branch_base="origin/ ${{ env.BRANCH_MAIN }}"
2626 else
2727 branch_head="refs/pull/${{ github.event.pull_request.number }}/merge"
28- branch_base="${{ github.event.pull_request.base.ref }}"
28+ branch_base="origin/ ${{ github.event.pull_request.base.ref }}"
2929 fi
3030 echo BRANCH_HEAD="$branch_head" >> "$GITHUB_ENV"
3131 echo BRANCH_BASE="$branch_base" >> "$GITHUB_ENV"
3737 - name : Run tests
3838 id : linter
3939 run : |
40+ git log -n 1 --pretty='format:%ci %h %s %d%n'
4041 # Diff against the common ancestor of the source (head) branch and the target (base) branch.
4142 echo "Diffing ${{ env.BRANCH_HEAD }} against ${{ env.BRANCH_BASE }}."
42- readarray -t files < <(git diff --diff-filter d --name-only origin/ ${{ env.BRANCH_BASE }}...)
43+ readarray -t files < <(git diff --diff-filter d --name-only ${{ env.BRANCH_BASE }}...)
4344 if [ ${#files[@]} -eq 0 ]; then
4445 echo "::notice::No files to lint."
4546 echo "linter_ran=0" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments