Skip to content

Commit e5fdae6

Browse files
committed
Use branch latest sha in nightly OCI
Instead of the SHA from the GitHub context, which returns the SHA from the cloned repository (so always main). The SHA from main then ends up in the broker version, which is confusing for other branches.
1 parent 656a4bf commit e5fdae6

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.github/workflows/oci-make-nightly.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,21 @@ jobs:
3939
fetch-depth: 0
4040
filter: blob:none
4141

42-
- name: Determine closes tag
42+
- name: Determine closest tag
4343
id: tag
4444
if: matrix.branch != 'main'
4545
shell: bash
4646
run: |
4747
t=$(git describe --tags --abbrev=0 ${{ matrix.branch }})
4848
printf "project_version=%s\n" "${t:1}" | tee -a "$GITHUB_OUTPUT"
4949
50+
- name: Get current SHA
51+
id: sha
52+
shell: bash
53+
run: |
54+
sha=$(git rev-parse HEAD)
55+
printf "current_sha=%s\n" "$sha" | tee -a "$GITHUB_OUTPUT"
56+
5057
- name: Configure Erlang
5158
uses: erlef/setup-beam@v1
5259
with:
@@ -56,7 +63,7 @@ jobs:
5663
- name: make package-generic-unix
5764
id: make
5865
run: |
59-
make package-generic-unix PROJECT_VERSION=${{ matrix.project_version || steps.tag.outputs.project_version }}+${{ github.sha }}
66+
make package-generic-unix PROJECT_VERSION=${{ matrix.project_version || steps.tag.outputs.project_version }}+${{ steps.sha.outputs.current_sha }}
6067
6168
- name: Upload package-generic-unix
6269
uses: actions/upload-artifact@v4
@@ -84,6 +91,13 @@ jobs:
8491
with:
8592
ref: ${{ matrix.branch }}
8693

94+
- name: Get current SHA
95+
id: sha
96+
shell: bash
97+
run: |
98+
sha=$(git rev-parse HEAD)
99+
printf "current_sha=%s\n" "$sha" | tee -a "$GITHUB_OUTPUT"
100+
87101
- name: Download package-generic-unix
88102
uses: actions/download-artifact@v5
89103
with:
@@ -133,4 +147,4 @@ jobs:
133147
cache-from: type=gha,scope=${{ matrix.otp_version }}
134148
build-args: |
135149
OTP_VERSION=${{ matrix.otp_version }}
136-
RABBITMQ_VERSION=${{ matrix.branch }}+${{ github.sha }}
150+
RABBITMQ_VERSION=${{ matrix.branch }}+${{ steps.sha.outputs.current_sha }}

0 commit comments

Comments
 (0)