Skip to content

Commit 0e2c688

Browse files
Using two separate jobs didn't work well. Using "exit 1" to abort instead.
1 parent 10752b4 commit 0e2c688

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.github/workflows/smoketest.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ permissions:
1414
statuses: read # Required for checking if all commit statuses are "success" in order to deploy the PR
1515

1616
jobs:
17-
permission-check:
17+
Linux:
1818
runs-on: ubuntu-latest
1919
environment: smoketest
2020
if: github.event.issue.pull_request # Make sure the comment is on a PR
21-
outputs:
22-
allowed: ${{ steps.branch-deploy.outputs.continue }}
2321
steps:
24-
- name: branch-deploy
22+
- name: Branch Deploy
2523
id: branch-deploy
2624
uses: github/branch-deploy@48285b12b35e47e2dde0c27d2abb33daa846d98b # v11.0.0
2725
with:
@@ -31,12 +29,16 @@ jobs:
3129
stable_branch: "main"
3230
update_branch: "disabled"
3331

34-
run-tests:
35-
runs-on: ubuntu-latest
36-
environment: smoketest
37-
needs: permission-check
38-
if: needs.permission-check.outputs.allowed == 'true'
39-
steps:
32+
- name: Check branch-deploy result
33+
env:
34+
BRANCH_DEPLOY_RESULT: ${{ steps.branch-deploy.outputs.continue }}
35+
run: |
36+
# Make the job stop with an error if branch-deploy didn't return "true".
37+
if [ "$BRANCH_DEPLOY_RESULT" != "true" ] ; then
38+
echo "Branch Deploy didn't return true. Aborting the job."
39+
exit 1
40+
fi
41+
4042
- name: Setup Python
4143
uses: actions/setup-python@v5
4244
with:

0 commit comments

Comments
 (0)