Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/reusable-jira-pr_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ permissions:

jobs:
get_issue_key:
if: ${{ github.event.pull_request.user.login != 'dependabot' && github.event.pullrequest.user.type != 'Bot' }}
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
Expand All @@ -39,6 +38,7 @@ jobs:
steps:
- name: Find JIRA issue key from branch
id: issue_key_from_branch
if: ${{ !startsWith(github.head_ref, 'dependabot/') && github.head_ref != 'pre-commit-ci-update-config' }}
env:
HEAD_REF: ${{ github.head_ref }}
run: >
Expand Down Expand Up @@ -80,9 +80,22 @@ jobs:

echo "issue_key=$issue_key" >> $GITHUB_OUTPUT

- name: Fail if no Jira key and not expected bot PR
if: ${{ !steps.issue_key.outputs.issue_key &&
!(github.event.sender.login == 'dependabot[bot]' && startsWith(github.head_ref, 'dependabot/github-actions/') && contains(github.head_ref, '/mirageo-ci-tools') && startsWith(github.event.pull_request.title, 'Bump ')) &&
!(github.event.sender.login == 'pre-commit-ci[bot]' && github.head_ref == 'pre-commit-ci-update-config') }}
run: |
echo "::error::No Jira issue key found. Please include one in your PR title (e.g. ABC-123: your title)"
exit 1


add_jira_summary:
if: ${{ github.event.action == 'opened' }}
if: ${{ needs.get_issue_key.result == 'success' &&
!startsWith(github.event.pull_request.body, format('**{0}', needs.get_issue_key.outputs.issue_key)) &&
(github.event.action == 'opened' ||
(github.event.action == 'synchronize' &&
github.event.pull_request.user.type == 'Bot' &&
github.event.sender.type == 'User')) }}
runs-on: ubuntu-latest
timeout-minutes: 20
needs: get_issue_key
Expand Down Expand Up @@ -128,6 +141,7 @@ jobs:
> /dev/null

check_jira_issue:
if: ${{ needs.get_issue_key.result == 'success' }}
runs-on: ubuntu-latest
timeout-minutes: 20
needs: get_issue_key
Expand Down
Loading