Skip to content

Commit 1173996

Browse files
committed
Refactor the publish job.
1 parent 087e3cb commit 1173996

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/actions/gobase/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
image:
55
description: 'CI Image'
66
required: true
7+
options:
8+
description: 'Extra options for the container'
9+
required: false
710
run:
811
description: 'Run command in the container'
912
required: false
@@ -16,8 +19,8 @@ runs:
1619
username: ${{ env.QUAY_USER }}
1720
password: ${{ env.QUAY_PASSWORD }}
1821
image: ${{ inputs.image }}
19-
options: -v ${{ github.workspace }}:/workspace # NOTE: Assumes the repo is checked out beforehand.
22+
options: -v ${{ github.workspace }}:/workspace ${{ inputs.options }} # NOTE: Assumes the repo is checked out beforehand.
2023
run: |
21-
git config --global --add safe.directory /workspace # Needed for goreleaser.
24+
git config --global --add safe.directory /workspace # Needed for goreleaser.
2225
cd /workspace
2326
${{ inputs.run }}

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,21 +212,15 @@ jobs:
212212

213213
- name: Generate release notes
214214
id: release-notes
215-
uses: addnab/docker-run-action@v3
215+
uses: ./.github/actions/gobase
216216
with:
217-
registry: quay.io
218217
image: quay.io/stackstate/go-rk:v0.2.3
219-
username: ${{ env.QUAY_USER }}
220-
password: ${{ env.QUAY_PASSWORD }}
221218
options: >
222-
-v ${{ github.workspace }}:/workspace
223219
-e RK_JIRA_PROJECT=STAC
224220
-e RK_JIRA_URL=https://stackstate.atlassian.net
225221
-e RK_JIRA_USER:${{ secrets.JIRA_USERNAME }}
226222
-e RK_JIRA_TOKEN:${{ secrets.JIRA_TOKEN }}
227223
run: |
228-
git config --global --add safe.directory /workspace
229-
cd /workspace
230224
/go-rk release-notes --fix-version cli2-${{ env.TAG }} --output-file release-notes.md --title "CLI ${{ env.TAG }}"
231225
/go-rk release-notes --fix-version cli2-${{ env.TAG }} -o json --output-file release-notes.json --title "CLI ${{ env.TAG }}"
232226
@@ -236,6 +230,12 @@ jobs:
236230
name: release-notes
237231
path: release-notes.md
238232

233+
- name: Save JSON release notes
234+
uses: actions/upload-artifact@v3
235+
with:
236+
name: release-notes-json
237+
path: release-notes.json
238+
239239
- name: Publish
240240
uses: ./.github/actions/gobase
241241
with:

0 commit comments

Comments
 (0)