Skip to content

Commit 0b7f4c5

Browse files
committed
update workflow_dispatch to manually test
1 parent 508a775 commit 0b7f4c5

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

.github/workflows/integration-tests.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
name: Integration Tests
22

33
on:
4+
push:
5+
branches: [main]
6+
tags:
7+
- "v*"
8+
pull_request:
9+
branches: [main]
10+
schedule:
11+
- cron: "0 7 * * *"
412
workflow_dispatch:
513
inputs:
614
pr_number:
715
type: number
8-
required: true
16+
required: false
17+
description: 'PR number (optional, for manual PR testing)'
918
sha:
1019
type: string
11-
required: true
20+
required: false
21+
description: 'SHA to test (optional, for manual PR testing)'
1222

1323
permissions:
1424
contents: read
@@ -25,18 +35,19 @@ jobs:
2535
steps:
2636
- uses: actions/checkout@v5
2737
with:
28-
ref: 'refs/pull/${{ github.event.inputs.pr_number }}/merge'
38+
ref: ${{ github.event.inputs.pr_number && format('refs/pull/{0}/merge', github.event.inputs.pr_number) || github.ref }}
2939
fetch-depth: 0
3040

3141
- name: Check SHA
42+
if: github.event.inputs.pr_number && github.event.inputs.sha
3243
run: |
3344
git fetch origin refs/pull/${{ github.event.inputs.pr_number }}/head:pr-head
3445
prsha=`git rev-parse pr-head | awk '{ print $1 }'`
3546
3647
echo "PR SHA: $prsha"
37-
echo "expected SHA: ${{ github.event.inputs.SHA }}"
48+
echo "expected SHA: ${{ github.event.inputs.sha }}"
3849
39-
if [ "$prsha" != "${{ github.event.inputs.SHA }}" ]; then
50+
if [ "$prsha" != "${{ github.event.inputs.sha }}" ]; then
4051
echo "SHA must match" >&2
4152
exit 1
4253
fi
@@ -124,11 +135,11 @@ jobs:
124135
steps:
125136
- uses: actions/checkout@v5
126137
with:
127-
ref: 'refs/pull/${{ github.event.inputs.pr_number }}/merge'
138+
ref: ${{ github.event.inputs.pr_number && format('refs/pull/{0}/merge', github.event.inputs.pr_number) || github.ref }}
128139
fetch-depth: 0
129140

130141
- name: Get PR Commit
131-
if: always() && matrix.runner-os == 'ubuntu-latest'
142+
if: always() && matrix.runner-os == 'ubuntu-latest' && github.event.inputs.pr_number
132143
run: |
133144
prsha=`git ls-remote origin refs/pull/${{ github.event.inputs.pr_number }}/head | awk '{ print $1 }'`
134145
echo "SHA: $prsha"

0 commit comments

Comments
 (0)