File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,16 @@ name: O2 linter
44
55" on " : [pull_request_target, push]
66permissions : {}
7- env :
8- HEAD_BRANCH : ${{ github.event_name == 'push' && github.ref || 'refs/pull/'{{ github.event.number }}'/merge' }}
9- BASE_BRANCH : ${{ github.event_name == 'push' && 'master' || github.event.pull_request.base.ref }}
107
118concurrency :
129 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
1310 cancel-in-progress : true
1411
1512jobs :
1613 o2-linter :
14+ env :
15+ branch_head : ${{ github.event_name == 'push' && github.ref || 'refs/pull/'{{ github.event.number }}'/merge' }}
16+ branch_base : ${{ github.event_name == 'push' && 'master' || github.event.pull_request.base.ref }}
1717 name : O2 linter
1818 runs-on : ubuntu-24.04
1919 permissions :
@@ -22,14 +22,14 @@ jobs:
2222 - name : Checkout Code
2323 uses : actions/checkout@v4
2424 with :
25- ref : ${{ env.HEAD_BRANCH }}
25+ ref : ${{ env.branch_head }}
2626 fetch-depth : 0 # needed to get the full history
2727 - name : Run tests
2828 id : linter
2929 run : |
3030 # Diff against the common ancestor of the source branch and the target branch.
31- echo "Diffing ${{ env.HEAD_BRANCH }} against ${{ env.BASE_BRANCH }}."
32- readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BASE_BRANCH }}...)
31+ echo "Diffing ${{ env.branch_head }} against ${{ env.branch_base }}."
32+ readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.branch_base }}...)
3333 if [ ${#files[@]} -eq 0 ]; then
3434 echo "::notice::No files to lint."
3535 echo "linter_ran=0" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments