github-for-jira icon indicating copy to clipboard operation
github-for-jira copied to clipboard

Don't display GitHub Actions in Jira if all jobs are skipped

Open atrigueiro opened this issue 3 years ago • 3 comments

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.

Screen Shot 2021-11-15 at 2 52 54 pm

atrigueiro avatar Nov 15 '21 03:11 atrigueiro

@atrigueiro Can you give an example of the whole workflow file?

mboudreau avatar Nov 18 '21 23:11 mboudreau

@mboudreau sure :) https://github.com/atrigueiro/test-github-jira/blob/main/.github/workflows/deploy.yml#L12

atrigueiro avatar Nov 23 '21 00:11 atrigueiro

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: image

These cancelled workflow runs then appear in Jira as failed deployments: image

...and we're seeing a lot of these! image

marktarry-mobysoft avatar Apr 19 '23 15:04 marktarry-mobysoft