Skip to content

Commit 54c7b1f

Browse files
authored
[skip changelog] Add workflow to mirror issue on Jira to ease grooming (#851)
1 parent e6f8274 commit 54c7b1f

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/jira-issue.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "Mirror new issue to Jira for grooming"
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
create-issue:
9+
runs-on: ubuntu-latest
10+
11+
env:
12+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
13+
14+
steps:
15+
- name: Installs Jira CLI
16+
uses: atlassian/gajira-cli@master
17+
with:
18+
version: 1.0.23
19+
20+
- name: Create issue
21+
run: |
22+
jira create \
23+
--noedit \
24+
-e ${{ secrets.JIRA_BASE_URL }} \
25+
-u ${{ secrets.JIRA_USER_EMAIL }} \
26+
-p ${{ secrets.JIRA_PROJECT_CODE }} \
27+
-i Task \
28+
-o summary="${{ github.event.issues.issue.title }}" \
29+
-o description="${{ github.event.issues.issue.body }}\n${{ github.event.issues.issue.html_url }}" \
30+
>> output
31+
32+
- name: Set label on Jira issue
33+
run: |
34+
jira label add
35+
$(cat output | awk '{split($0,a," "); print a[2]}')
36+
grooming arduino-cli
37+
38+
- name: Set label on Github issue
39+
uses: actions/github-script@v2
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
script: |
43+
github.issues.addLabels({
44+
issue_number: context.issue.number,
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
labels: ['tracked']
48+
})

0 commit comments

Comments
 (0)