From 7177b4fa957490acf1e93c953f4f02fc42e79e45 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 7 Jan 2022 12:51:51 +0100 Subject: [PATCH] ci: limit github-jira sync actions to a single concurrent run to prevent race conditions when two workflows related to the same new issue are triggered within a short interval. --- .github/workflows/issue_comment.yml | 4 ++++ .github/workflows/new_issues.yml | 4 ++++ .github/workflows/new_prs.yml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/issue_comment.yml b/.github/workflows/issue_comment.yml index 2970c2eaad..05ff94d5e9 100644 --- a/.github/workflows/issue_comment.yml +++ b/.github/workflows/issue_comment.yml @@ -3,6 +3,10 @@ name: Sync issue comments to JIRA # This workflow will be triggered when new issue comment is created (including PR comments) on: issue_comment +# Limit to single concurrent run for workflows which can create Jira issues. +# Same concurrency group is used in new_issues.yml +concurrency: jira_issues + jobs: sync_issue_comments_to_jira: name: Sync Issue Comments to Jira diff --git a/.github/workflows/new_issues.yml b/.github/workflows/new_issues.yml index a8e0eb014b..f52e0c9c94 100644 --- a/.github/workflows/new_issues.yml +++ b/.github/workflows/new_issues.yml @@ -3,6 +3,10 @@ name: Sync issues to Jira # This workflow will be triggered when a new issue is opened on: issues +# Limit to single concurrent run for workflows which can create Jira issues. +# Same concurrency group is used in issue_comment.yml +concurrency: jira_issues + jobs: sync_issues_to_jira: name: Sync issues to Jira diff --git a/.github/workflows/new_prs.yml b/.github/workflows/new_prs.yml index 0aa1d83721..df4a18e3f2 100644 --- a/.github/workflows/new_prs.yml +++ b/.github/workflows/new_prs.yml @@ -6,6 +6,10 @@ on: schedule: - cron: "0 * * * *" +# Limit to single concurrent run for workflows which can create Jira issues. +# Same concurrency group is used in issue_comment.yml +concurrency: jira_issues + jobs: sync_prs_to_jira: name: Sync PRs to Jira