Skip to content

Commit 01fac1e

Browse files
authored
Revert "chore: remove unused actions (#16)" (#17)
This reverts commit 489acc5.
1 parent 7bd1bae commit 01fac1e

10 files changed

+461
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: SmartBear Supported Branch Created
2+
3+
# Example of trigger for this workflow:
4+
#
5+
# on:
6+
# create:
7+
# branches:
8+
# - 'feature/**'
9+
10+
on:
11+
workflow_call:
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
name: Transition Jira ticket to In Progress
17+
steps:
18+
- name: login
19+
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
20+
env:
21+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
22+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
23+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
24+
25+
- name: Find Issue
26+
id: find
27+
uses: atlassian/gajira-find-issue-key@7d9cbdfce900a0fcf608050ce728620a928be8b6 # v3
28+
with:
29+
from: branch
30+
31+
- run: echo "${{ steps.find.outputs.issue }}"
32+
33+
- name: Transition issue
34+
if: steps.find.outputs.issue != ''
35+
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
36+
with:
37+
issue: ${{ steps.find.outputs.issue }}
38+
transition: "In Progress"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: SmartBear Supported Issue Closed
2+
3+
# Example of trigger for this workflow:
4+
#
5+
# on:
6+
# issues:
7+
# types:
8+
# - closed
9+
10+
on:
11+
workflow_call:
12+
13+
jobs:
14+
if_closed:
15+
runs-on: ubuntu-latest
16+
name: Transition Jira ticket to Close
17+
steps:
18+
- name: login
19+
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
20+
env:
21+
JIRA_BASE_URL: ${{ secrets.SMARTBEAR_JIRA_BASE_URL }}
22+
JIRA_USER_EMAIL: ${{ secrets.SMARTBEAR_JIRA_USER_EMAIL }}
23+
JIRA_API_TOKEN: ${{ secrets.SMARTBEAR_JIRA_API_TOKEN }}
24+
25+
- name: Search
26+
id: search
27+
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
28+
with:
29+
jql: 'summary ~ "${{ github.event.repository.name }}#${{ github.event.issue.number }}:" AND project=${{ vars.SMARTBEAR_JIRA_PROJECT }}'
30+
31+
- name: Log
32+
run: echo "Found issue ${{ steps.search.outputs.issue }}"
33+
34+
- name: Transition issue
35+
if: steps.search.outputs.issue != ''
36+
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
37+
with:
38+
issue: ${{ steps.search.outputs.issue }}
39+
transition: "Done"
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: SmartBear Supported Issue Comment Created
2+
3+
# Example of trigger for this workflow:
4+
#
5+
# on:
6+
# issue_comment:
7+
# types:
8+
# - created
9+
10+
on:
11+
workflow_call:
12+
13+
jobs:
14+
jira:
15+
runs-on: ubuntu-latest
16+
if: ${{ github.event.comment.body == '/smartbear-supported issue' }}
17+
steps:
18+
- run: echo ${{ github.event.comment.body }}
19+
20+
- name: Login
21+
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
22+
env:
23+
JIRA_BASE_URL: ${{ secrets.SMARTBEAR_JIRA_BASE_URL }}
24+
JIRA_USER_EMAIL: ${{ secrets.SMARTBEAR_JIRA_USER_EMAIL }}
25+
JIRA_API_TOKEN: ${{ secrets.SMARTBEAR_JIRA_API_TOKEN }}
26+
ISSUE_TITLE: ${{ github.event.issue.title }}
27+
28+
- name: Search
29+
id: search
30+
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
31+
with:
32+
jql: 'summary ~ "${{ github.event.repository.name }}#${{ github.event.issue.number }}:" AND project=${{ vars.SMARTBEAR_JIRA_PROJECT }}'
33+
34+
- name: Log
35+
run: echo "Found issue ${{ steps.search.outputs.issue }}"
36+
37+
- name: Create
38+
id: create
39+
if: steps.search.outputs.issue == ''
40+
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3
41+
with:
42+
project: ${{ secrets.SMARTBEAR_JIRA_PROJECT }}
43+
issuetype: Task
44+
summary: '${{ github.event.repository.name }}#${{ github.event.issue.number }}: ${{ github.event.issue.title }}'
45+
description: |
46+
*Issue Link:* ${{ github.event.issue.html_url }}
47+
48+
${{ github.event.issue.body }}
49+
fields: '{"customfield_10006": ${{ toJSON(secrets.SMARTBEAR_JIRA_EPIC_TICKET) }}, "customfield_17401":{"value":${{ toJSON( secrets.SMARTBEAR_JIRA_LAYER_CAKE )}}}}'
50+
51+
- name: Add Comment
52+
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
53+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
54+
with:
55+
github-token: ${{secrets.GITHUB_TOKEN}}
56+
script: |
57+
github.rest.issues.createComment({
58+
issue_number: context.issue.number,
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
body: "👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (${{steps.create.outputs.issue}}). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps. <br/><br/>See our <a href='https://docs.pact.io/help/smartbear'>documentation</a> for more information."
62+
})
63+
64+
- name: Add Jira Label
65+
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1
66+
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
67+
with:
68+
labels: smartbear-supported
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: SmartBear Supported Issue Label Added
2+
3+
# Example of trigger for this workflow:
4+
#
5+
# on:
6+
# issues:
7+
# types:
8+
# - labeled
9+
10+
on:
11+
workflow_call:
12+
13+
jobs:
14+
create-issue-in-pactflow-jira:
15+
runs-on: ubuntu-latest
16+
if: github.event.label.name == 'smartbear-supported'
17+
steps:
18+
- name: Login
19+
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
20+
env:
21+
JIRA_BASE_URL: ${{ secrets.SMARTBEAR_JIRA_BASE_URL }}
22+
JIRA_USER_EMAIL: ${{ secrets.SMARTBEAR_JIRA_USER_EMAIL }}
23+
JIRA_API_TOKEN: ${{ secrets.SMARTBEAR_JIRA_API_TOKEN }}
24+
25+
- name: Search
26+
id: search
27+
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
28+
with:
29+
jql: 'summary ~ "${{ github.event.repository.name }}#${{ github.event.issue.number }}:" AND project=${{ vars.SMARTBEAR_JIRA_PROJECT }}'
30+
31+
- name: Log
32+
run: echo "Found issue ${{ steps.search.outputs.issue }}"
33+
34+
- name: Create
35+
id: create
36+
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3
37+
if: steps.search.outputs.issue == ''
38+
with:
39+
project: ${{ vars.SMARTBEAR_JIRA_PROJECT }}
40+
issuetype: Task
41+
summary: '${{ github.event.repository.name }}#${{ github.event.issue.number }}: ${{ github.event.issue.title }}'
42+
description: |
43+
*Issue Link:* ${{ github.event.issue.html_url }}
44+
45+
${{ github.event.issue.body }}
46+
fields: '{"customfield_10006": ${{ toJSON(secrets.SMARTBEAR_JIRA_EPIC_TICKET) }}, "customfield_17401":{"value":${{ toJSON( secrets.SMARTBEAR_JIRA_LAYER_CAKE )}}}}'
47+
48+
- name: Add Comment
49+
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
50+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
51+
with:
52+
github-token: ${{secrets.GITHUB_TOKEN }}
53+
script: |
54+
github.rest.issues.createComment({
55+
issue_number: context.issue.number,
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
body: "👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (${{steps.create.outputs.issue}}). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps. <br/><br/>See our <a href='https://docs.pact.io/help/smartbear'>documentation</a> for more information."
59+
})
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: SmartBear Supported Issue Opened
2+
3+
# Example of trigger for this workflow:
4+
#
5+
# on:
6+
# issues:
7+
# types:
8+
# - opened
9+
10+
on:
11+
workflow_call:
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
name: Create Jira Ticket
17+
steps:
18+
- name: Login
19+
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
20+
env:
21+
SMARTBEAR_JIRA_BASE_URL: ${{ secrets.SMARTBEAR_JIRA_BASE_URL }}
22+
SMARTBEAR_JIRA_USER_EMAIL: ${{ secrets.SMARTBEAR_JIRA_USER_EMAIL }}
23+
SMARTBEAR_JIRA_API_TOKEN: ${{ secrets.SMARTBEAR_JIRA_API_TOKEN }}
24+
25+
- name: Search
26+
id: search
27+
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
28+
with:
29+
jql: 'summary ~ "${{ github.event.repository.name }}#${{ github.event.issue.number }}:" AND project=${{ vars.SMARTBEAR_JIRA_PROJECT }}'
30+
31+
- name: Create
32+
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3
33+
id: create
34+
with:
35+
project: ${{ secrets.SMARTBEAR_JIRA_PROJECT }}
36+
issuetype: Task
37+
summary: '${{ github.event.repository.name }}#${{ github.event.issue.number }}: ${{ github.event.issue.title }}'
38+
description: |
39+
*Issue Link:* ${{ github.event.issue.html_url }}
40+
41+
${{ github.event.issue.body }}
42+
fields: '{"customfield_10006": ${{ toJSON(secrets.SMARTBEAR_JIRA_EPIC_TICKET) }}, "customfield_17401":{"value":${{ toJSON( secrets.SMARTBEAR_JIRA_LAYER_CAKE )}}}}'
43+
44+
- name: Add Jira Label
45+
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1
46+
if: steps.create.outputs.issue != ''
47+
with:
48+
labels: smartbear-supported
49+
50+
- name: Add Comment
51+
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
52+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
53+
with:
54+
github-token: ${{secrets.GITHUB_TOKEN}}
55+
script: |
56+
github.rest.issues.createComment({
57+
issue_number: context.issue.number,
58+
owner: context.repo.owner,
59+
repo: context.repo.repo,
60+
body: "👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (${{steps.create.outputs.issue}}). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps. <br/><br/>See our <a href='https://docs.pact.io/help/smartbear'>documentation</a> for more information."
61+
})
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: SmartBear Supported Pull Request Assigned
2+
3+
# Example of trigger for this workflow:
4+
#
5+
# on:
6+
# pull_request:
7+
# types:
8+
# - assigned
9+
10+
on:
11+
workflow_call:
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
name: Jira ticket transitioned to In Review
17+
steps:
18+
- name: login
19+
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
20+
env:
21+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
22+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
23+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
24+
25+
- run: echo ${{ github.event.pull_request.title }}
26+
27+
- name: Find Issue
28+
id: find
29+
uses: atlassian/gajira-find-issue-key@7d9cbdfce900a0fcf608050ce728620a928be8b6 # v3
30+
with:
31+
string: ${{ github.event.pull_request.title }}
32+
33+
- run: echo "${{ steps.find.outputs.issue }}"
34+
35+
- name: Transition issue
36+
if: steps.find.outputs.issue != ''
37+
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
38+
with:
39+
issue: ${{ steps.find.outputs.issue }}
40+
transition: "In Progress"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: SmartBear Supported Pull Request Comment Created
2+
3+
# Scenario: Once the code author commits all changes to branch, and PR updated,
4+
# they can comment with "/done"
5+
6+
# Example of trigger for this workflow:
7+
#
8+
# on:
9+
# issue_comment:
10+
# types: [created]
11+
12+
on:
13+
workflow_call:
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/done') }}
19+
name: Transition Jira Ticket to In Review
20+
steps:
21+
- name: login
22+
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
23+
env:
24+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
25+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
26+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
27+
28+
- run: echo ${{ github.event.issue.title }}
29+
30+
- name: Find Issue
31+
id: find
32+
uses: atlassian/gajira-find-issue-key@7d9cbdfce900a0fcf608050ce728620a928be8b6 # v3
33+
with:
34+
string: ${{ github.event.issue.title }}
35+
36+
- run: echo "${{ steps.find.outputs.issue }}"
37+
38+
- name: Transition issue
39+
if: steps.find.outputs.issue != ''
40+
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
41+
with:
42+
issue: ${{ steps.find.outputs.issue }}
43+
transition: "In Progress"

0 commit comments

Comments
 (0)