From fcfeea1baabdf1130ea09db6a8516241723a7fce Mon Sep 17 00:00:00 2001 From: peifeng-unity Date: Tue, 26 Oct 2021 17:40:01 -0700 Subject: [PATCH 1/4] add jira-link check --- .github/workflows/jira-link.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/jira-link.yaml diff --git a/.github/workflows/jira-link.yaml b/.github/workflows/jira-link.yaml new file mode 100644 index 00000000..3ea6e082 --- /dev/null +++ b/.github/workflows/jira-link.yaml @@ -0,0 +1,24 @@ +name: jira-link + +on: + pull_request: + branches: + - main + - dev + +jobs: + jira-link: + runs-on: ubuntu-20.04 + steps: + - name: check pull request title and source branch name + run: | + echo "Checking pull request with title ${{ github.event.pull_request.title }} from source branch ${{ github.event.pull_request.head.ref }}" + if ! [[ "${{ github.event.pull_request.title }}" =~ ^AIRO-[0-9]+[[:space:]].*$ ]] && ! [[ "${{ github.event.pull_request.head.ref }}" =~ ^AIRO-[0-9]+.*$ ]] + then + echo -e "Please make sure one of the following is true:\n \ + 1. the pull request title starts with 'AIRO-xxxx ', e.g. 'AIRO-1024 My Pull Request'\n \ + 2. the source branch starts with 'AIRO-xxx', e.g. 'AIRO-1024-my-branch'" + exit 1 + else + echo "Completed checking" + fi From d5b2a66517276a6234062a8c4b8200903ddc56e2 Mon Sep 17 00:00:00 2001 From: peifeng-unity Date: Wed, 27 Oct 2021 10:27:44 -0700 Subject: [PATCH 2/4] add pull request event types --- .github/workflows/jira-link.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/jira-link.yaml b/.github/workflows/jira-link.yaml index 3ea6e082..8ad94438 100644 --- a/.github/workflows/jira-link.yaml +++ b/.github/workflows/jira-link.yaml @@ -2,6 +2,7 @@ name: jira-link on: pull_request: + types: [opened, edited, reopened, synchronize, ready_for_review, review_requested] branches: - main - dev From 6e452999c7a8687831a6f7ae894a48270dd4241a Mon Sep 17 00:00:00 2001 From: peifeng-unity Date: Wed, 27 Oct 2021 10:40:45 -0700 Subject: [PATCH 3/4] only add edit event to trigger the check --- .github/workflows/jira-link.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jira-link.yaml b/.github/workflows/jira-link.yaml index 8ad94438..1a68dbcc 100644 --- a/.github/workflows/jira-link.yaml +++ b/.github/workflows/jira-link.yaml @@ -2,7 +2,7 @@ name: jira-link on: pull_request: - types: [opened, edited, reopened, synchronize, ready_for_review, review_requested] + types: [opened, edited, reopened, synchronize] branches: - main - dev From 9acd651879a15b8068b1c6429c50fefae7f851da Mon Sep 17 00:00:00 2001 From: peifeng-unity Date: Wed, 27 Oct 2021 13:52:50 -0700 Subject: [PATCH 4/4] check for all branches --- .github/workflows/jira-link.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/jira-link.yaml b/.github/workflows/jira-link.yaml index 1a68dbcc..18240fb7 100644 --- a/.github/workflows/jira-link.yaml +++ b/.github/workflows/jira-link.yaml @@ -3,9 +3,6 @@ name: jira-link on: pull_request: types: [opened, edited, reopened, synchronize] - branches: - - main - - dev jobs: jira-link: