Skip to content

Commit 563ed6a

Browse files
committed
fix: refer to the correct branch
1 parent e22439f commit 563ed6a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/build-push.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v5
17+
with:
18+
ref: ${{ github.event.workflow_run.head_sha }}
1719

1820
- name: Log in to container registry
1921
uses: docker/login-action@v3
@@ -25,8 +27,8 @@ jobs:
2527
- name: Determine image tag
2628
id: tag
2729
run: |
28-
REF="${{ github.ref }}"
29-
if [ "$REF" = "refs/heads/main" ]; then
30+
BRANCH="${{ github.event.workflow_run.head_branch }}"
31+
if [ "$BRANCH" = "main" ]; then
3032
echo "env_tag=latest" >> $GITHUB_OUTPUT
3133
else
3234
echo "env_tag=test" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)