github-for-jira
github-for-jira copied to clipboard
Don't display GitHub Actions in Jira if all jobs are skipped
GitHub Actions allows users to skip a job, using something like if: github.ref == 'refs/heads/main'
in their .yml
file.
If all jobs from a workflow are skipped, we shouldn't display the workflow as a build/deploy in Jira, since nothing ran.
@atrigueiro Can you give an example of the whole workflow file?
@mboudreau sure :) https://github.com/atrigueiro/test-github-jira/blob/main/.github/workflows/deploy.yml#L12
Another use-case for this is where a deployment workflow is triggered, but never executed due to use of either (or both!):
We typically use both of these features for our deployment workflows:
- Deployments are triggered by a
release
event (type=published
) - Many of our environments will have protection rules enabled - requiring at least 1 approval
- All of our deployment workflows use
concurrency
guards to block concurrent deployments to the same environment
If a release goes unapproved, it is cancelled by GitHub when the next release
event is triggered:
These cancelled workflow runs then appear in Jira as failed deployments:
...and we're seeing a lot of these!