mirror of
https://github.com/hashicorp/vault-action.git
synced 2025-11-14 18:13:45 +00:00
Update jira sync github action
This commit is contained in:
parent
cf359605d7
commit
0d34061b85
1 changed files with 4 additions and 12 deletions
16
.github/workflows/jira.yaml
vendored
16
.github/workflows/jira.yaml
vendored
|
|
@ -45,22 +45,14 @@ jobs:
|
||||||
echo "::set-output name=type::ISS"
|
echo "::set-output name=type::ISS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run GitHub flavored (gfm) markdown through pandoc to convert to jira markdown
|
|
||||||
# Then replace newlines with %0A so that newlines get preserved when storing in the step output
|
|
||||||
# The %0A will then get expanded back to real new lines when the output is included in a later step inside $ {{}} syntax
|
|
||||||
BODY="$(cat <<"EOF-PandocInput" | docker run -i --rm pandoc/core:2.11.0.4 --from gfm --to jira | awk '{printf "%s%%0A", $0}'
|
|
||||||
${{ github.event.comment.body || github.event.review.body || github.event.issue.body || github.event.pull_request.body }}
|
|
||||||
EOF-PandocInput
|
|
||||||
)"
|
|
||||||
echo "::set-output name=body::${BODY}"
|
|
||||||
- name: Create ticket
|
- name: Create ticket
|
||||||
if: github.event.action == 'opened' && !steps.vault-team-role.outputs.role
|
if: github.event.action == 'opened' && !steps.vault-team-role.outputs.role
|
||||||
uses: tomhjp/gh-action-jira-create@v0.1.4
|
uses: tomhjp/gh-action-jira-create@v0.2.0
|
||||||
with:
|
with:
|
||||||
project: VAULT
|
project: VAULT
|
||||||
issuetype: "GH Issue"
|
issuetype: "GH Issue"
|
||||||
summary: "${{ github.event.repository.name }} [${{ steps.preprocess.outputs.type }} #${{ github.event.issue.number || github.event.pull_request.number }}]: ${{ github.event.issue.title || github.event.pull_request.title }}"
|
summary: "${{ github.event.repository.name }} [${{ steps.preprocess.outputs.type }} #${{ github.event.issue.number || github.event.pull_request.number }}]: ${{ github.event.issue.title || github.event.pull_request.title }}"
|
||||||
description: "${{ steps.preprocess.outputs.body }}\n\n_Created from GitHub Action for ${{ github.event.issue.html_url || github.event.pull_request.html_url }} from ${{ github.actor }}_"
|
description: "${{ github.event.issue.body || github.event.pull_request.body }}\n\n_Created from GitHub Action for ${{ github.event.issue.html_url || github.event.pull_request.html_url }} from ${{ github.actor }}_"
|
||||||
# customfield_10089 is Issue Link custom field
|
# customfield_10089 is Issue Link custom field
|
||||||
# customfield_10091 is team custom field
|
# customfield_10091 is team custom field
|
||||||
extraFields: '{"fixVersions": [{"name": "TBD"}], "customfield_10091": ["ecosystem"], "customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}"}'
|
extraFields: '{"fixVersions": [{"name": "TBD"}], "customfield_10091": ["ecosystem"], "customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}"}'
|
||||||
|
|
@ -75,10 +67,10 @@ jobs:
|
||||||
|
|
||||||
- name: Sync comment
|
- name: Sync comment
|
||||||
if: github.event.action == 'created' && steps.search.outputs.issue
|
if: github.event.action == 'created' && steps.search.outputs.issue
|
||||||
uses: tomhjp/gh-action-jira-comment@v0.1.1
|
uses: tomhjp/gh-action-jira-comment@v0.2.0
|
||||||
with:
|
with:
|
||||||
issue: ${{ steps.search.outputs.issue }}
|
issue: ${{ steps.search.outputs.issue }}
|
||||||
comment: "${{ github.actor }} ${{ github.event.review.state || 'commented' }}:\n\n${{ steps.preprocess.outputs.body }}\n\n${{ github.event.comment.html_url || github.event.review.html_url }}"
|
comment: "${{ github.actor }} ${{ github.event.review.state || 'commented' }}:\n\n${{ github.event.comment.body || github.event.review.body }}\n\n${{ github.event.comment.html_url || github.event.review.html_url }}"
|
||||||
|
|
||||||
- name: Close ticket
|
- name: Close ticket
|
||||||
if: (github.event.action == 'closed' || github.event.action == 'deleted') && steps.search.outputs.issue
|
if: (github.event.action == 'closed' || github.event.action == 'deleted') && steps.search.outputs.issue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue