Skip to content

Commit 19026ac

Browse files
committed
Load repository infor before build and push
1 parent ca432e7 commit 19026ac

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,23 @@ jobs:
2525
username: ${{ secrets.DOCKER_USERNAME }}
2626
password: ${{ secrets.DOCKER_PASSWORD }}
2727

28-
- name: Build and push Docker image
29-
uses: docker/build-push-action@v6
30-
with:
31-
context: .
32-
push: true
33-
platforms: linux/amd64,linux/arm64
34-
tags: ${{ github.repository }}:${{ github.event.release.tag_name }},${{ github.repository }}:latest
35-
3628
- name: Set repository info
3729
run: |
3830
if [[ -z "${{ env.repository_name }}" ]]; then
31+
echo "::notice title=Unresolved GH context::GitHub context for 'repository.name' did not resolve"
3932
REPO_NAME="${GITHUB_REPOSITORY}"
4033
else
4134
REPO_NAME="${{ env.repository_name }}"
4235
fi
4336
if [ -z "$REPO_NAME" ]; then
37+
echo "::warning title=Unresolved key::Guard rail for repository name failed, using fallback."
4438
echo "REPO_NAME=thevickypedia/github-runner-linux" >> $GITHUB_ENV
4539
else
4640
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
4741
fi
4842
4943
if [[ -z "${{ env.repository_desc }}" ]]; then
44+
echo "::notice title=Unresolved GH context::GitHub context for 'repository.description' did not resolve"
5045
echo REPO_DESCRIPTION="Spin up an on-demand self-hosted GitHub action runner with multi-arch supported Ubuntu image." >> $GITHUB_ENV
5146
else
5247
echo REPO_DESCRIPTION="${{ env.repository_desc }}" >> $GITHUB_ENV
@@ -56,6 +51,14 @@ jobs:
5651
repository_name: "${{ github.repository.name }}"
5752
repository_desc: "${{ github.repository.description }}"
5853

54+
- name: Build and push Docker image
55+
uses: docker/build-push-action@v6
56+
with:
57+
context: .
58+
push: true
59+
platforms: linux/amd64,linux/arm64
60+
tags: ${{ github.repository }}:${{ github.event.release.tag_name }},${{ github.repository }}:latest
61+
5962
- name: Update description
6063
uses: thevickypedia/describe-docker@v1
6164
with:

0 commit comments

Comments
 (0)