Skip to content

Commit 671be87

Browse files
Add Jira integration
1 parent 80b846f commit 671be87

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Part of
2+
<!--
3+
Only for standalone PRs without Jira issue in the PR title:
4+
* Replace this comment with Epic ID to create a new Task in Jira
5+
* Replace this comment with Issue ID to create a new Sub-Task in Jira
6+
* Ignore or delete this note to create a new Task in Jira without a parent
7+
-->
8+
19
Please be aware that we are not actively looking for feature contributions. The truth is that it's extremely difficult for someone outside SonarSource to comply with our roadmap and expectations. Therefore, we typically only accept minor cosmetic changes and typo fixes. If you would like to see a new feature, please create a new thread in the forum ["Suggest new features"](https://community.sonarsource.com/c/suggestions/features).
210

311
With that in mind, if you would like to submit a code contribution, make sure that you adhere to the following guidelines and all tests are passing:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
steps:
18+
- id: secrets
19+
uses: SonarSource/vault-action-wrapper@v3
20+
with:
21+
secrets: |
22+
development/kv/data/jira user | JIRA_USER;
23+
development/kv/data/jira token | JIRA_TOKEN;
24+
- uses: sonarsource/gh-action-lt-backlog/PullRequestClosed@v2
25+
with:
26+
github-token: ${{secrets.GITHUB_TOKEN}}
27+
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
28+
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
Lines changed: 29 additions & 0 deletions
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: SONARJNKNS
Lines changed: 28 additions & 0 deletions
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

Lines changed: 30 additions & 0 deletions
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)