-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[.github] add hints to test locally and prevent parising failures for…
… the first run (#1122)
- Loading branch information
Showing
1 changed file
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|