Skip to content

Commit 86c6fa1

Browse files
authored
Use ref_name as current tag value (#214)
1 parent 5893d92 commit 86c6fa1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

.github/workflows/publish.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ env:
1212
PACT_VERSION: ${{ github.ref_name }}
1313
PACT_BROKER_BASE_URL: ${{ vars.PACT_BROKER_BASE_URL }}
1414
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
15+
GIT_TAG: ${{ github.ref_name }}
1516

1617
jobs:
1718
get-tags:
1819
runs-on: ubuntu-22.04
1920
outputs:
20-
tag: ${{ steps.get-tags.outputs.tag }}
2121
previous-tag: ${{ steps.get-tags.outputs.previous-tag }}
2222
steps:
2323
- name: Checkout
@@ -29,13 +29,12 @@ jobs:
2929
with:
3030
script: |
3131
const {
32-
data: [latest, previous],
32+
data: [previous],
3333
} = await github.rest.repos.listReleases({
3434
...context.repo,
35-
per_page: 2,
35+
per_page: 1,
3636
page: 1,
3737
});
38-
core.setOutput("tag", latest.tag_name.replace(/^v/, ''));
3938
core.setOutput("previous-tag", previous.tag_name.replace(/^v/, ''));
4039
4140
generate-release-notes-pr:
@@ -49,7 +48,6 @@ jobs:
4948
- name: Generate Release Notes PR
5049
env:
5150
GIT_PREV_TAG: ${{ needs.get-tags.outputs.previous-tag }}
52-
GIT_TAG: ${{ needs.get-tags.outputs.tag }}
5351
GH_PAT: ${{ secrets.GH_PAT }}
5452
run: |
5553
curl -H "Authorization: token $GH_PAT" \
@@ -108,8 +106,8 @@ jobs:
108106
id: build-push-action
109107
with:
110108
context: deploy
111-
image-name: index.docker.io/replicated/replicated-sdk:v${{needs.get-tags.outputs.tag}}
112-
git-tag: v${{needs.get-tags.outputs.tag}}
109+
image-name: index.docker.io/replicated/replicated-sdk:${{ github.ref_name }}
110+
git-tag: ${{ github.ref_name }}
113111
registry-username: ${{ secrets.DOCKERHUB_USER }}
114112
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
115113

@@ -125,10 +123,10 @@ jobs:
125123
126124
- name: Run Package and Publish
127125
env:
128-
REPLICATED_TAG: ${{needs.get-tags.outputs.tag}}
126+
REPLICATED_TAG: ${{ github.ref_name }}
129127
REPLICATED_REGISTRY: docker.io
130128
REPLICATED_CHART_NAME: replicated
131-
REPLICATED_CHART_VERSION: ${{needs.get-tags.outputs.tag}}
129+
REPLICATED_CHART_VERSION: ${{ github.ref_name }}
132130
REPLICATED_USER_STAGING: ${{secrets.REPLICATED_USER_STAGING}}
133131
REPLICATED_PASS_STAGING: ${{secrets.REPLICATED_PASS_STAGING}}
134132
REPLICATED_USER_PROD: ${{secrets.REPLICATED_USER_PROD}}
@@ -182,7 +180,7 @@ jobs:
182180
if: success() && needs.package-and-publish.result == 'success'
183181
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
184182
with:
185-
image: index.docker.io/replicated/replicated-sdk:${{ needs.get-tags.outputs.tag }}
183+
image: index.docker.io/replicated/replicated-sdk:${{ github.ref_name }}
186184
digest: ${{ needs.package-and-publish.outputs.digest }}
187185
secrets:
188186
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}

0 commit comments

Comments
 (0)