Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kferles/add jira workflows #37

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
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
40 changes: 40 additions & 0 deletions .github/workflows/jira-finished-transition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
pull_request:
types: ['closed']
branches: [ llvm ]


name: Transition Issue to Done

jobs:
transition-issue:
if: 'github.event.pull_request.merged == true'
name: Transition Issue to In Review
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: recursive
persist-credentials: false

- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Find Issue Key
id: find
uses: atlassian/gajira-find-issue-key@v3
continue-on-error: true
with:
string: ${{ github.head_ref }}

- name: Transition issue
uses: atlassian/gajira-transition@v3
continue-on-error: true
with:
issue: ${{ steps.find.outputs.issue }}
transition: Merged
40 changes: 40 additions & 0 deletions .github/workflows/jira-in-review-transition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
pull_request:
types: ['opened', 'ready_for_review']
branches: [ llvm ]


name: Transition Issue to In Review

jobs:
transition-issue:
if: '! github.event.pull_request.draft'
name: Transition Issue to In Review
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: recursive
persist-credentials: false

- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Find Issue Key
id: find
uses: atlassian/gajira-find-issue-key@v3
continue-on-error: true
with:
string: ${{ github.head_ref }}

- name: Transition issue
uses: atlassian/gajira-transition@v3
continue-on-error: true
with:
issue: ${{ steps.find.outputs.issue }}
transition: Review
60 changes: 60 additions & 0 deletions .github/workflows/jira-to-merge-transition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
pull_request_review:
types: [submitted]
branches: [ llvm ]


name: Transition Issue to "To Merge" State

jobs:
transition-issue:
name: Transition Issue to In Review
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: recursive
persist-credentials: false

- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- uses: luisrjaeger/[email protected]
id: approved
with:
# defaults to one approval, leaving it this here in case we
# want to increase it in the future.
# approvals: 2
check_changes_requested: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Find Issue Key
id: find
uses: atlassian/gajira-find-issue-key@v3
continue-on-error: true
with:
string: ${{ github.event.pull_request.head.ref }}

# This progress to Verify. Eventually, it should be the last step of this workflow.
- name: Transition issue 1
if: ${{ steps.approved.outputs.approved == 'true' }}
uses: atlassian/gajira-transition@v3
continue-on-error: true
with:
issue: ${{ steps.find.outputs.issue }}
transition: Approved by reviewer

# Our imaginary Q/A team approves. This should be moved to a different workflow.
- name: Transition issue 2
if: ${{ steps.approved.outputs.approved == 'true' }}
uses: atlassian/gajira-transition@v3
continue-on-error: true
with:
issue: ${{ steps.find.outputs.issue }}
transition: Q/A team approves
Loading