Skip to content

Commit

Permalink
[.github] add hints to test locally and prevent parising failures for…
Browse files Browse the repository at this point in the history
… the first run (#1122)
  • Loading branch information
kylos101 committed Jul 12, 2023
1 parent 022d1b4 commit f99ba64
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/dockerhub-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ jobs:
run: |
# Generate a temporal file to store skopeo auth
SKOPEO_AUTH_FILE=$(mktemp)
# to test locally
# export GITHUB_ENV=$(mktemp)
echo "SKOPEO_AUTH_FILE=${SKOPEO_AUTH_FILE}" >> $GITHUB_ENV
# Build a fake skopeo script to run a container
cat <<'EOF' > /usr/local/bin/skopeo
cat <<EOF | sudo tee /usr/local/bin/skopeo > /dev/null
#/bin/bash
docker run --rm -v $SKOPEO_AUTH_FILE:/skopeo.auth -e REGISTRY_AUTH_FILE=/skopeo.auth quay.io/skopeo/stable:v1.12.0 "$@"
docker run --rm -v $SKOPEO_AUTH_FILE:/skopeo.auth -e REGISTRY_AUTH_FILE=/skopeo.auth quay.io/skopeo/stable:v1.12.0 "\$@"
EOF
chmod +x /usr/local/bin/skopeo
sudo chmod +x /usr/local/bin/skopeo
# delete the file, so skopeo doesn't try parsing it, initially
rm "${SKOPEO_AUTH_FILE}"
# don't fail parsing the file while it contains empty creds the first time
echo "{}" > $SKOPEO_AUTH_FILE
- name: ☁️ Set up Cloud SDK
uses: google-github-actions/[email protected]
Expand Down

0 comments on commit f99ba64

Please sign in to comment.