Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/smartbear-branch-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: SmartBear Supported Branch Created

# Example of trigger for this workflow:
#
# on:
# create:
# branches:
# - 'feature/**'

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
name: Transition Jira ticket to In Progress
steps:
- name: login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Find Issue
id: find
uses: atlassian/gajira-find-issue-key@7d9cbdfce900a0fcf608050ce728620a928be8b6 # v3
with:
from: branch

- run: echo "${{ steps.find.outputs.issue }}"

- name: Transition issue
if: steps.find.outputs.issue != ''
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
with:
issue: ${{ steps.find.outputs.issue }}
transition: "In Progress"
39 changes: 39 additions & 0 deletions .github/workflows/smartbear-issue-closed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: SmartBear Supported Issue Closed

# Example of trigger for this workflow:
#
# on:
# issues:
# types:
# - closed

on:
workflow_call:

jobs:
if_closed:
runs-on: ubuntu-latest
name: Transition Jira ticket to Close
steps:
- name: login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.SMARTBEAR_JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.SMARTBEAR_JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.SMARTBEAR_JIRA_API_TOKEN }}

- name: Search
id: search
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
with:
jql: 'summary ~ "${{ github.event.repository.name }}#${{ github.event.issue.number }}:" AND project=${{ vars.SMARTBEAR_JIRA_PROJECT }}'

- name: Log
run: echo "Found issue ${{ steps.search.outputs.issue }}"

- name: Transition issue
if: steps.search.outputs.issue != ''
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
with:
issue: ${{ steps.search.outputs.issue }}
transition: "Done"
68 changes: 68 additions & 0 deletions .github/workflows/smartbear-issue-comment-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: SmartBear Supported Issue Comment Created

# Example of trigger for this workflow:
#
# on:
# issue_comment:
# types:
# - created

on:
workflow_call:

jobs:
jira:
runs-on: ubuntu-latest
if: ${{ github.event.comment.body == '/smartbear-supported issue' }}
steps:
- run: echo ${{ github.event.comment.body }}

- name: Login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.SMARTBEAR_JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.SMARTBEAR_JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.SMARTBEAR_JIRA_API_TOKEN }}
ISSUE_TITLE: ${{ github.event.issue.title }}

- name: Search
id: search
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
with:
jql: 'summary ~ "${{ github.event.repository.name }}#${{ github.event.issue.number }}:" AND project=${{ vars.SMARTBEAR_JIRA_PROJECT }}'

- name: Log
run: echo "Found issue ${{ steps.search.outputs.issue }}"

- name: Create
id: create
if: steps.search.outputs.issue == ''
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3
with:
project: ${{ secrets.SMARTBEAR_JIRA_PROJECT }}
issuetype: Task
summary: '${{ github.event.repository.name }}#${{ github.event.issue.number }}: ${{ github.event.issue.title }}'
description: |
*Issue Link:* ${{ github.event.issue.html_url }}

${{ github.event.issue.body }}
fields: '{"customfield_10006": ${{ toJSON(secrets.SMARTBEAR_JIRA_EPIC_TICKET) }}, "customfield_17401":{"value":${{ toJSON( secrets.SMARTBEAR_JIRA_LAYER_CAKE )}}}}'

- name: Add Comment
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
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."
})

- name: Add Jira Label
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
with:
labels: smartbear-supported
59 changes: 59 additions & 0 deletions .github/workflows/smartbear-issue-label-added.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: SmartBear Supported Issue Label Added

# Example of trigger for this workflow:
#
# on:
# issues:
# types:
# - labeled

on:
workflow_call:

jobs:
create-issue-in-pactflow-jira:
runs-on: ubuntu-latest
if: github.event.label.name == 'smartbear-supported'
steps:
- name: Login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.SMARTBEAR_JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.SMARTBEAR_JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.SMARTBEAR_JIRA_API_TOKEN }}

- name: Search
id: search
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
with:
jql: 'summary ~ "${{ github.event.repository.name }}#${{ github.event.issue.number }}:" AND project=${{ vars.SMARTBEAR_JIRA_PROJECT }}'

- name: Log
run: echo "Found issue ${{ steps.search.outputs.issue }}"

- name: Create
id: create
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3
if: steps.search.outputs.issue == ''
with:
project: ${{ vars.SMARTBEAR_JIRA_PROJECT }}
issuetype: Task
summary: '${{ github.event.repository.name }}#${{ github.event.issue.number }}: ${{ github.event.issue.title }}'
description: |
*Issue Link:* ${{ github.event.issue.html_url }}

${{ github.event.issue.body }}
fields: '{"customfield_10006": ${{ toJSON(secrets.SMARTBEAR_JIRA_EPIC_TICKET) }}, "customfield_17401":{"value":${{ toJSON( secrets.SMARTBEAR_JIRA_LAYER_CAKE )}}}}'

- name: Add Comment
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
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 changes: 61 additions & 0 deletions .github/workflows/smartbear-issue-opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: SmartBear Supported Issue Opened

# Example of trigger for this workflow:
#
# on:
# issues:
# types:
# - opened

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
name: Create Jira Ticket
steps:
- name: Login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
SMARTBEAR_JIRA_BASE_URL: ${{ secrets.SMARTBEAR_JIRA_BASE_URL }}
SMARTBEAR_JIRA_USER_EMAIL: ${{ secrets.SMARTBEAR_JIRA_USER_EMAIL }}
SMARTBEAR_JIRA_API_TOKEN: ${{ secrets.SMARTBEAR_JIRA_API_TOKEN }}

- name: Search
id: search
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
with:
jql: 'summary ~ "${{ github.event.repository.name }}#${{ github.event.issue.number }}:" AND project=${{ vars.SMARTBEAR_JIRA_PROJECT }}'

- name: Create
uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3
id: create
with:
project: ${{ secrets.SMARTBEAR_JIRA_PROJECT }}
issuetype: Task
summary: '${{ github.event.repository.name }}#${{ github.event.issue.number }}: ${{ github.event.issue.title }}'
description: |
*Issue Link:* ${{ github.event.issue.html_url }}

${{ github.event.issue.body }}
fields: '{"customfield_10006": ${{ toJSON(secrets.SMARTBEAR_JIRA_EPIC_TICKET) }}, "customfield_17401":{"value":${{ toJSON( secrets.SMARTBEAR_JIRA_LAYER_CAKE )}}}}'

- name: Add Jira Label
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1
if: steps.create.outputs.issue != ''
with:
labels: smartbear-supported

- name: Add Comment
if: steps.search.outputs.issue == '' && steps.create.outputs.issue != ''
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
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."
})
40 changes: 40 additions & 0 deletions .github/workflows/smartbear-pull-request-assigned.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: SmartBear Supported Pull Request Assigned

# Example of trigger for this workflow:
#
# on:
# pull_request:
# types:
# - assigned

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
name: Jira ticket transitioned to In Review
steps:
- name: login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- run: echo ${{ github.event.pull_request.title }}

- name: Find Issue
id: find
uses: atlassian/gajira-find-issue-key@7d9cbdfce900a0fcf608050ce728620a928be8b6 # v3
with:
string: ${{ github.event.pull_request.title }}

- run: echo "${{ steps.find.outputs.issue }}"

- name: Transition issue
if: steps.find.outputs.issue != ''
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
with:
issue: ${{ steps.find.outputs.issue }}
transition: "In Progress"
43 changes: 43 additions & 0 deletions .github/workflows/smartbear-pull-request-comment-created.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: SmartBear Supported Pull Request Comment Created

# Scenario: Once the code author commits all changes to branch, and PR updated,
# they can comment with "/done"

# Example of trigger for this workflow:
#
# on:
# issue_comment:
# types: [created]

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/done') }}
name: Transition Jira Ticket to In Review
steps:
- name: login
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- run: echo ${{ github.event.issue.title }}

- name: Find Issue
id: find
uses: atlassian/gajira-find-issue-key@7d9cbdfce900a0fcf608050ce728620a928be8b6 # v3
with:
string: ${{ github.event.issue.title }}

- run: echo "${{ steps.find.outputs.issue }}"

- name: Transition issue
if: steps.find.outputs.issue != ''
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
with:
issue: ${{ steps.find.outputs.issue }}
transition: "In Progress"
Loading