Skip to content

Commit 51c9b23

Browse files
authored
Merge pull request #98 from metacpan/haarg/set-image-full-tag
set-image workflow: accept full tag and base tag rather than repository
2 parents 2191280 + 1a107e0 commit 51c9b23

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/set-image.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ on:
1818
options:
1919
- prod
2020
- stage
21-
repository:
22-
description: 'Repository'
23-
required: true
21+
base-tag:
22+
description: 'Base Image Tag'
2423
type: string
2524
tag:
26-
description: 'Tag'
25+
description: 'Image Tag'
2726
required: true
2827
type: string
2928

@@ -33,26 +32,26 @@ jobs:
3332

3433
steps:
3534
- name: Generate Auth Token
36-
id: auth-token
37-
uses: jamestrousdale/github-app-jwt-token@0.1.4
35+
uses: actions/create-github-app-token@v1
36+
id: app-token
3837
with:
3938
app-id: ${{ secrets.APP_ID }}
4039
private-key: ${{ secrets.APP_PRIVATE_KEY }}
4140
- id: git-user
4241
name: Set up git user
4342
uses: haarg/setup-git-user@v1
4443
with:
45-
jwt: ${{ steps.auth-token.outputs.jwt }}
44+
app: ${{ steps.app-token.outputs.app-slug }}
4645
- uses: actions/checkout@v4
4746
with:
48-
token: ${{ steps.auth-token.outputs.access-token }}
47+
token: ${{ steps.app-token.outputs.token }}
4948
- name: Set up Kustomize
5049
uses: imranismail/setup-kustomize@v2
5150
- name: Update Image Tag
5251
working-directory: ./apps/${{ inputs.app }}/environments/${{ inputs.environment }}
5352
run: |
54-
kustomize edit set image "${{ inputs.repository }}:latest" "${{ inputs.repository }}:${{ inputs.tag }}"
53+
kustomize edit set image ${{ inputs.base-tag }} ${{ inputs.tag }}
5554
git add .
56-
git commit -m "Update ${{ inputs.app }} to ${{ github.sha }}"
55+
git commit -m "Update ${{ inputs.app }} to `${{ inputs.tag }}`"
5756
- name: Push manifests
5857
run: git push

0 commit comments

Comments
 (0)