Skip to content

Commit 0aed737

Browse files
Add Jira integration
1 parent 754f54f commit 0aed737

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
Only for standalone PRs without Jira issue in the PR title:
3+
* Replace this comment with Epic ID to create a new Task in Jira
4+
* Replace this comment with Issue ID to create a new Sub-Task in Jira
5+
* Ignore or delete this note to create a new Task in Jira without a parent
6+
-->
7+
18
List of checkpoint to verify/do before merging a PR.
29

310
### Dev checklist
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Pull Request Closed
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
PullRequestMerged_job:
9+
name: Pull Request Merged
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
pull-requests: read
14+
# For external PR, ticket should be moved manually
15+
if: |
16+
github.event.pull_request.head.repo.full_name == github.repository
17+
&& github.event.pull_request.merged
18+
steps:
19+
- id: secrets
20+
uses: SonarSource/vault-action-wrapper@v3
21+
with:
22+
secrets: |
23+
development/kv/data/jira user | JIRA_USER;
24+
development/kv/data/jira token | JIRA_TOKEN;
25+
- uses: sonarsource/gh-action-lt-backlog/PullRequestClosed@v2
26+
with:
27+
github-token: ${{secrets.GITHUB_TOKEN}}
28+
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
29+
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Pull Request Created
2+
3+
on:
4+
pull_request:
5+
types: ["opened"]
6+
7+
jobs:
8+
PullRequestCreated_job:
9+
name: Pull Request Created
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
# For external PR, ticket should be created manually
14+
if: |
15+
github.event.pull_request.head.repo.full_name == github.repository
16+
steps:
17+
- id: secrets
18+
uses: SonarSource/vault-action-wrapper@v3
19+
with:
20+
secrets: |
21+
development/github/token/{REPO_OWNER_NAME_DASH}-jira token | GITHUB_TOKEN;
22+
development/kv/data/jira user | JIRA_USER;
23+
development/kv/data/jira token | JIRA_TOKEN;
24+
- uses: sonarsource/gh-action-lt-backlog/PullRequestCreated@v2
25+
with:
26+
github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
27+
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
28+
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
29+
jira-project: SCCPPGHA

.github/workflows/RequestReview.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Request review
2+
3+
on:
4+
pull_request:
5+
types: ["review_requested"]
6+
7+
jobs:
8+
RequestReview_job:
9+
name: Request review
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
# For external PR, ticket should be moved manually
14+
if: |
15+
github.event.pull_request.head.repo.full_name == github.repository
16+
steps:
17+
- id: secrets
18+
uses: SonarSource/vault-action-wrapper@v3
19+
with:
20+
secrets: |
21+
development/github/token/{REPO_OWNER_NAME_DASH}-jira token | GITHUB_TOKEN;
22+
development/kv/data/jira user | JIRA_USER;
23+
development/kv/data/jira token | JIRA_TOKEN;
24+
- uses: sonarsource/gh-action-lt-backlog/RequestReview@v2
25+
with:
26+
github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
27+
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
28+
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}

.github/workflows/SubmitReview.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Submit Review
2+
3+
on:
4+
pull_request_review:
5+
types: [submitted]
6+
7+
jobs:
8+
SubmitReview_job:
9+
name: Submit Review
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
pull-requests: read
14+
# For external PR, ticket should be moved manually
15+
if: |
16+
github.event.pull_request.head.repo.full_name == github.repository
17+
&& (github.event.review.state == 'changes_requested'
18+
|| github.event.review.state == 'approved')
19+
steps:
20+
- id: secrets
21+
uses: SonarSource/vault-action-wrapper@v3
22+
with:
23+
secrets: |
24+
development/kv/data/jira user | JIRA_USER;
25+
development/kv/data/jira token | JIRA_TOKEN;
26+
- uses: sonarsource/gh-action-lt-backlog/SubmitReview@v2
27+
with:
28+
github-token: ${{secrets.GITHUB_TOKEN}}
29+
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
30+
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}

0 commit comments

Comments
 (0)