Skip to content

Commit

Permalink
chore: make GHA cancel not throw an error for the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
tlebon committed Dec 19, 2024
1 parent 1ff7b42 commit dc42b9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ jobs:

- name: Deploy to precommit environment
id: deploy
if: ${{ needs.build.outputs.total_additions > 100 && github.actor != 'dependabot[bot]' }}
if: ${{ always() }}
run: |
if [[ ${{ needs.build.outputs.total_additions }} -le 100 || "${{ github.actor }}" == "dependabot[bot]" ]]; then
echo "Skipping deployment"
exit 0
fi
uses: einaregilsson/beanstalk-deploy@v22
with:
application_name: Webapp
Expand Down
4 changes: 3 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ pipeline {
return workflowRuns.any { run ->
def result = checkWorkflowRun(run, commit_hash)
if (run['conclusion'] == 'cancelled') {
error("GitHub Action was cancelled. Aborting Jenkins pipeline.")
echo("GitHub Action was cancelled. Ending Jenkins pipeline.")
return true
}

return result
}
}
Expand Down

0 comments on commit dc42b9e

Please sign in to comment.