Skip to content

Commit 612d7d9

Browse files
authored
Merge pull request #146 from github-copilot-resources/bugfix/latest-tag
include latest tag
2 parents ce69e47 + aabe825 commit 612d7d9

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/deploy_to_ghcr_custom_tag.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
description: 'existing git tag to be used as tag for the Docker image e.g. "custom-tag"'
99
required: true
1010
default: 'my-tag'
11+
include_latest:
12+
description: 'should latest tag be included in the image tag'
13+
required: true
14+
default: 'true'
1115

1216
permissions:
1317
packages: write
@@ -40,6 +44,7 @@ jobs:
4044
org.opencontainers.image.source=${{ github.repository }}
4145
tags: |
4246
type=raw,enable=true,priority=1,value=${{ github.event.inputs.tag }}
47+
type=raw,enable=${{ github.event.inputs.include_latest }},priority=2,value=latest
4348
type=sha
4449
type=ref,event=branch
4550
type=ref,event=pr
@@ -82,6 +87,7 @@ jobs:
8287
org.opencontainers.image.source=${{ github.repository }}
8388
tags: |
8489
type=raw,enable=true,priority=1,value=${{ github.event.inputs.tag }}
90+
type=raw,enable=${{ github.event.inputs.include_latest }},priority=2,value=latest
8591
type=sha
8692
type=ref,event=branch
8793
type=ref,event=pr

.github/workflows/deploy_to_ghcr_tag_release.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,9 @@ jobs:
4444
git add .
4545
git commit --signoff --message $version
4646
47-
echo "moving tag $version"
48-
git tag --force $version
49-
git push origin $version --force
50-
5147
- name: Create Pull Request
5248
uses: peter-evans/create-pull-request@v7
49+
continue-on-error: true
5350
with:
5451
title: '🚀Update version to ${{ steps.version.outputs.version }}'
5552
body: |
@@ -59,6 +56,12 @@ jobs:
5956
delete-branch: true
6057
labels: 'version-update'
6158
base: 'main'
59+
60+
- name: Move tag ${{ steps.version.outputs.version }} to PR
61+
run: |
62+
echo "moving tag ${{ steps.version.outputs.version }}"
63+
git tag --force ${{ steps.version.outputs.version }}
64+
git push origin ${{ steps.version.outputs.version }} --force
6265
6366
push_to_ghcr:
6467
runs-on: ubuntu-latest
@@ -86,6 +89,7 @@ jobs:
8689
org.opencontainers.image.description=Metrics viewer for GitHub Copilot usage
8790
org.opencontainers.image.source=${{ github.repository }}
8891
tags: |
92+
type=raw,value=latest,enable=true
8993
type=sha
9094
type=ref,event=branch
9195
type=ref,event=pr
@@ -126,6 +130,7 @@ jobs:
126130
org.opencontainers.image.description=Metrics viewer for GitHub Copilot usage
127131
org.opencontainers.image.source=${{ github.repository }}
128132
tags: |
133+
type=raw,value=latest,enable=true
129134
type=sha
130135
type=ref,event=branch
131136
type=ref,event=pr

0 commit comments

Comments
 (0)