Skip to content

Commit b6580c8

Browse files
authored
Fix workflow fails if job is not submitted (#10)
Changes: - 'export' was succeeding, so the workflow passed. Now separates to two steps which should fail properly. - Add failing test
1 parent c017ff2 commit b6580c8

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ jobs:
4545
| 😎 Workflow URL | ${{ steps.runs.outputs.workflowUrl }} |
4646
comment_tag: towerrun
4747
if: github.event_name == 'pull_request'
48+
49+
- uses: ./
50+
id: runfails
51+
continue-on-error: true
52+
with:
53+
pipeline: no_pipeline_exists
54+
revision: master
55+
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
56+
access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
57+
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
58+
run_name: ${{ github.job }}_${{ github.sha }}
59+
workdir: ${{ secrets.AWS_S3_BUCKET }}/work/${{ github.sha }}
60+
61+
- name: Check Failure
62+
if: steps.runfails.outcome == 'success'
63+
run: |
64+
echo "Failed to catch invalid pipeline submission: ${{ steps.runfails.outcome }}"
65+
exit 1
4866
4967
- uses: actions/upload-artifact@v3
5068
with:

entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if [ "$WAIT" = false ]; then unset WAIT; fi
3333

3434
# Launch the pipeline
3535
# We use capture the JSON as variable $OUT. We encode it as base64 to get around Github secrets filters but we still mask it anyway to make sure the details don't leak.
36-
export OUT=$(tw -o json -v \
36+
OUT=$(tw -o json -v \
3737
launch \
3838
$PIPELINE \
3939
--params-file=params.json \
@@ -45,7 +45,7 @@ export OUT=$(tw -o json -v \
4545
${PRE_RUN_SCRIPT:+"--pre-run=pre_run.sh"} \
4646
${NEXTFLOW_CONFIG:+"--config=nextflow.config"} \
4747
${WAIT:+"--wait=$WAIT"} \
48-
2>> $LOG_FN | tee -a $LOG_FN | base64 -w 0)
48+
2>> $LOG_FN | base64 -w 0)
4949

5050
# Base64 decode and extract specific value for output
5151
export workflowId=$(echo $OUT | base64 -d | jq -r '.workflowId')

0 commit comments

Comments
 (0)