Skip to content

Commit 872401a

Browse files
authored
ci: Create major version tag (#148)
This PR will create a tag associated to the major version every time a docker image is published. For example, if the current version is `v1.1.0`, it will also create a `v1` tag. The purpose of this is that it can be used in CI/local environments knowing that you will always get the latest version of `v1.x.x`.
1 parent a2593b4 commit 872401a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/actions/docker-build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
using: "composite"
4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4343

4444
- name: Set up Docker Buildx
4545
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ jobs:
3333
name: Create bump and changelog
3434
run: |
3535
cz bump --yes --changelog
36+
37+
PINNED_MAJOR=v${$(cz version -p)%%.*}
38+
git tag -d $PINNED_MAJOR || true # Delete previous major version tag
39+
git tag $PINNED_MAJOR HEAD
40+
3641
git push origin HEAD:main
3742
git push origin --tags
3843

.github/workflows/lgtm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- name: Checkout PR code
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4040
with:
4141
ref: refs/pull/${{ github.event.issue.number }}/merge
4242

4343
- name: Run LGTM Review
44-
uses: elementsinteractive/lgtm-ai-action@v1.0.0
44+
uses: elementsinteractive/lgtm-ai-action@a486ea03268e82d7fa11825718457cbb5cd90413 # v1.1.0
4545
with:
4646
ai-api-key: ${{ secrets.AI_API_TOKEN }}
4747
git-api-key: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)