-
Notifications
You must be signed in to change notification settings - Fork 9.3k
54 lines (54 loc) · 1.9 KB
/
post_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Post Publish
on:
workflow_dispatch:
inputs:
release-tag:
type: string
description: 'Semver release tag e.g. v1.1.0'
required: true
workflow_run:
workflows: [Release]
types:
- completed
jobs:
on-success-or-workflow-dispatch:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch'
outputs:
release-tag: ${{ steps.release-tag.outputs.tag }}
steps:
- if: github.event_name == 'workflow_run'
name: Download Artifact from Release workflow
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
with:
workflow: release.yml
name: release-tag
- name: Output Release Tag
id: release-tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "tag=${{ github.event.inputs.release-tag }}" >> "$GITHUB_OUTPUT"
else
value=`cat release-tag.data`
echo "tag=$value" >> "$GITHUB_OUTPUT"
fi
tidy-jira:
needs: [on-success-or-workflow-dispatch]
runs-on: ubuntu-latest
steps:
- name: Tidy Jira
uses: breathingdust/github-jira-tidy@77daa2cf0f0574bb7be001eb6380939c1af31672 # v0.9.0
with:
jira_host: 'hashicorp.atlassian.net'
jira_username: 'sdavis@hashicorp.com'
jira_password: ${{ secrets.jira_password }}
jira_jql_filter: ${{ secrets.jira_jql_filter }}
jira_closed_id: '371'
jira_github_url_field_id: 'cf[10089]'
github_release_name: ${{ needs.on-success-or-workflow-dispatch.outputs.release-tag }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'