Skip to content

Commit aeac379

Browse files
committed
chore: Common workflows for GitHub -> Jira integration, copied from c2pa-rs
0 parents  commit aeac379

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This ensures that when a user manually closes a ticket in Jira,
2+
# it will update the workflow labels appropriately.
3+
4+
name: Closing ticket
5+
on:
6+
issues:
7+
types: [closed]
8+
jobs:
9+
label_issues:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
steps:
14+
- run: 'gh issue edit "$NUMBER" --add-label "status: done" --remove-label "status: wip,status: todo,status: in progress,status: in test,status: not prioritized,status: blocked,status: api review,status: code review,status: design review,status: code complete,status: ready"'
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
GH_REPO: ${{ github.repository }}
18+
NUMBER: ${{ github.event.issue.number }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This ensures that when a ticket is labeled as Done in Jira, it will close the ticket on GitHub.
2+
3+
name: Labeling ticket "Done"
4+
on:
5+
issues:
6+
types: [labeled]
7+
jobs:
8+
label_issues:
9+
runs-on: ubuntu-latest
10+
if: |
11+
contains(github.event.issue.labels.*.name, 'status: done')
12+
permissions:
13+
issues: write
14+
steps:
15+
- run: 'gh issue close "$NUMBER"'
16+
env:
17+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
GH_REPO: ${{ github.repository }}
19+
NUMBER: ${{ github.event.issue.number }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This ensures that when a ticket is not labeled as Done in Jira, it will re-open the ticket on GitHub.
2+
3+
name: Labeling ticket "To Do"
4+
on:
5+
issues:
6+
types: [labeled]
7+
jobs:
8+
label_issues:
9+
runs-on: ubuntu-latest
10+
if: |
11+
!contains(github.event.issue.labels.*.name, 'status: done')
12+
permissions:
13+
issues: write
14+
steps:
15+
- run: 'gh issue reopen "$NUMBER"'
16+
env:
17+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
GH_REPO: ${{ github.repository }}
19+
NUMBER: ${{ github.event.issue.number }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This ensures that when a ticket is reopened in Jira, it will update the
2+
# workflow labels in GitHub appropriately.
3+
4+
name: Reopening ticket
5+
on:
6+
issues:
7+
types: [reopened]
8+
jobs:
9+
label_issues:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
steps:
14+
- run: 'gh issue edit "$NUMBER" --add-label "status: todo" --remove-label "status: wip,status: done,status: in progress,status: in test,status: not prioritized,status: blocked,status: api review,status: code review,status: design review,status: code complete,status: ready"'
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
GH_REPO: ${{ github.repository }}
18+
NUMBER: ${{ github.event.issue.number }}

0 commit comments

Comments
 (0)