|
9 | 9 | pull_request:
|
10 | 10 | release:
|
11 | 11 | types: [published]
|
12 |
| - check_suite: |
13 |
| - types: [rerequested] |
14 | 12 |
|
15 | 13 | concurrency:
|
16 | 14 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
@@ -64,24 +62,32 @@ jobs:
|
64 | 62 | PULL: ${{ github.event.number }}
|
65 | 63 | GITHUB_TOKEN: ${{ github.token }}
|
66 | 64 | EXCLUDE_COMMIT: ${{ github.event.pull_request.head.sha }}
|
67 |
| - - name: Set head sha |
| 65 | + - name: Set head sha (pull) |
68 | 66 | if: github.event_name == 'pull_request'
|
69 | 67 | run: echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
|
70 |
| - - name: Set base sha |
| 68 | + - name: Set base sha (pull) |
71 | 69 | if: github.event_name == 'pull_request'
|
72 | 70 | run: |
|
73 | 71 | git fetch --no-tags --no-recurse-submodules --depth=$((DEPTH + 1)) origin $HEAD_SHA
|
74 | 72 | echo "BASE_SHA=$(git rev-list $HEAD_SHA --skip=$DEPTH --max-count=1)" >> $GITHUB_ENV
|
75 | 73 | env:
|
76 | 74 | DEPTH: ${{ steps.get-last-commit-with-checks.outputs.commit_depth || github.event.pull_request.commits }}
|
| 75 | + - name: Set head sha (push) |
| 76 | + if: github.event_name == 'push' |
| 77 | + run: echo "HEAD_SHA=${{ github.event.after }}" >> $GITHUB_ENV |
| 78 | + - name: Set base sha (push) |
| 79 | + if: github.event_name == 'push' |
| 80 | + run: git cat-file -e $SHA && echo "BASE_SHA=$SHA" >> $GITHUB_ENV || true |
| 81 | + env: |
| 82 | + SHA: ${{ github.event.before }} |
77 | 83 | - name: Get changes
|
78 | 84 | id: get-changes
|
79 |
| - if: github.event_name == 'pull_request' |
| 85 | + if: env.BASE_SHA && env.HEAD_SHA |
80 | 86 | run: echo $(git diff $BASE_SHA...$HEAD_SHA --name-only) | echo "changed_files=[\"$(sed "s/ /\", \"/g")\"]" >> $GITHUB_OUTPUT
|
81 | 87 | - name: Set matrix
|
82 | 88 | id: set-matrix
|
83 |
| - working-directory: tools |
84 | 89 | run: python3 -u ci_set_matrix.py
|
| 90 | + working-directory: tools |
85 | 91 | env:
|
86 | 92 | CHANGED_FILES: ${{ steps.get-changes.outputs.changed_files }}
|
87 | 93 | LAST_FAILED_JOBS: ${{ steps.get-last-commit-with-checks.outputs.check_runs }}
|
|
0 commit comments