Skip to content

Commit ca432e7

Browse files
committed
Create fallbacks for update description stage in GHA workflow
1 parent 6faa0ed commit ca432e7

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,34 @@ jobs:
3333
platforms: linux/amd64,linux/arm64
3434
tags: ${{ github.repository }}:${{ github.event.release.tag_name }},${{ github.repository }}:latest
3535

36+
- name: Set repository info
37+
run: |
38+
if [[ -z "${{ env.repository_name }}" ]]; then
39+
REPO_NAME="${GITHUB_REPOSITORY}"
40+
else
41+
REPO_NAME="${{ env.repository_name }}"
42+
fi
43+
if [ -z "$REPO_NAME" ]; then
44+
echo "REPO_NAME=thevickypedia/github-runner-linux" >> $GITHUB_ENV
45+
else
46+
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
47+
fi
48+
49+
if [[ -z "${{ env.repository_desc }}" ]]; then
50+
echo REPO_DESCRIPTION="Spin up an on-demand self-hosted GitHub action runner with multi-arch supported Ubuntu image." >> $GITHUB_ENV
51+
else
52+
echo REPO_DESCRIPTION="${{ env.repository_desc }}" >> $GITHUB_ENV
53+
fi
54+
shell: bash
55+
env:
56+
repository_name: "${{ github.repository.name }}"
57+
repository_desc: "${{ github.repository.description }}"
58+
3659
- name: Update description
3760
uses: thevickypedia/describe-docker@v1
3861
with:
3962
username: ${{ secrets.DOCKER_USERNAME }}
4063
password: ${{ secrets.DOCKER_PASSWORD }}
41-
summary: "${{ github.repository.description }}"
42-
repository: ${{ github.repository.name }}
64+
summary: "${{ env.REPO_DESCRIPTION }}"
65+
repository: "${{ env.REPO_NAME }}"
4366
filename: "README.md"

0 commit comments

Comments
 (0)