11name : Integration Tests
22
33on :
4- push :
5- branches : [main]
6- tags :
7- - " v*"
8- pull_request :
9- branches : [main]
10- schedule :
11- - cron : " 0 7 * * *"
124 workflow_dispatch :
135 inputs :
146 pr_number :
157 type : number
16- required : false
17- description : ' PR number (optional, for manual PR testing)'
8+ required : true
189 sha :
1910 type : string
20- required : false
21- description : ' SHA to test (optional, for manual PR testing)'
11+ required : true
2212
2313permissions :
2414 contents : read
@@ -35,19 +25,18 @@ jobs:
3525 steps :
3626 - uses : actions/checkout@v5
3727 with :
38- ref : ${{ github.event.inputs.pr_number && format( 'refs/pull/{0}/merge', github.event.inputs.pr_number) || github.ref }}
28+ ref : ' refs/pull/${{ github.event.inputs.pr_number }}/merge '
3929 fetch-depth : 0
4030
4131 - name : Check SHA
42- if : github.event.inputs.pr_number && github.event.inputs.sha
4332 run : |
4433 git fetch origin refs/pull/${{ github.event.inputs.pr_number }}/head:pr-head
4534 prsha=`git rev-parse pr-head | awk '{ print $1 }'`
4635
4736 echo "PR SHA: $prsha"
48- echo "expected SHA: ${{ github.event.inputs.sha }}"
37+ echo "expected SHA: ${{ github.event.inputs.SHA }}"
4938
50- if [ "$prsha" != "${{ github.event.inputs.sha }}" ]; then
39+ if [ "$prsha" != "${{ github.event.inputs.SHA }}" ]; then
5140 echo "SHA must match" >&2
5241 exit 1
5342 fi
@@ -135,11 +124,11 @@ jobs:
135124 steps :
136125 - uses : actions/checkout@v5
137126 with :
138- ref : ${{ github.event.inputs.pr_number && format( 'refs/pull/{0}/merge', github.event.inputs.pr_number) || github.ref }}
127+ ref : ' refs/pull/${{ github.event.inputs.pr_number }}/merge '
139128 fetch-depth : 0
140129
141130 - name : Get PR Commit
142- if : always() && matrix.runner-os == 'ubuntu-latest' && github.event.inputs.pr_number
131+ if : always() && matrix.runner-os == 'ubuntu-latest'
143132 run : |
144133 prsha=`git ls-remote origin refs/pull/${{ github.event.inputs.pr_number }}/head | awk '{ print $1 }'`
145134 echo "SHA: $prsha"
0 commit comments