Skip to content

chore: update jsonnet [PF-2731] #14

chore: update jsonnet [PF-2731]

chore: update jsonnet [PF-2731] #14

Workflow file for this run

"jobs":
"verify-jsonnet-gh-actions":
"container":
"credentials":
"password": "${{ secrets.docker_gcr_io }}"
"username": "_json_key"
"image": "eu.gcr.io/unicorn-985/docker-images_jsonnet:v1"
"runs-on": "ubuntu-latest"
"steps":
- "id": "check-binaries"
"name": "check for ssh/git binaries"
"run": |
if command -v git;
then
echo "gitBinaryExists=true" >> $GITHUB_OUTPUT;
echo "Git binary exists";
else
echo "Attempt to install git binary";
if command -v apk; then
echo "apk exists";
apk add git && echo "gitBinaryExists=true" >> $GITHUB_OUTPUT;
elif command -v apt; then
echo "apt exists";
apt update && apt install -y git && echo "gitBinaryExists=true" >> $GITHUB_OUTPUT;
else
echo "No package manager found, unable to install git cli binary";
echo "gitBinaryExists=false" >> $GITHUB_OUTPUT;
fi;
fi;
if command -v ssh;
then
echo "sshBinaryExists=true" >> $GITHUB_OUTPUT;
echo "SSH binary exists";
exit 0;
else
echo "Attempt to install ssh binary";
if command -v apk; then
echo "apk exists";
apk add openssh-client && echo "sshBinaryExists=true" >> $GITHUB_OUTPUT && exit 0;
elif command -v apt; then
echo "apt exists";
apt update && apt install -y openssh-client && echo "sshBinaryExists=true" >> $GITHUB_OUTPUT && exit 0;
else
echo "No package manager found, unable to install ssh cli binary";
echo "sshBinaryExists=false" >> $GITHUB_OUTPUT;
fi;
fi;
echo "sshBinaryExists=false" >> $GITHUB_OUTPUT;
- "if": "${{ ( steps.check-binaries.outputs.sshBinaryExists == 'true' && steps.check-binaries.outputs.gitBinaryExists == 'true' ) }}"
"name": "Check out repository code via ssh"
"uses": "actions/checkout@v4"
"with":
"ref": "${{ github.event.pull_request.head.sha }}"
"ssh-key": "${{ secrets.VIRKO_GITHUB_SSH_KEY }}"
- "if": "${{ ( steps.check-binaries.outputs.sshBinaryExists == 'false' || steps.check-binaries.outputs.gitBinaryExists == 'false' ) }}"
"name": "Check out repository code via https"
"uses": "actions/checkout@v4"
"with":
"ref": "${{ github.event.pull_request.head.sha }}"
- "name": "git safe directory"
"run": "command -v git && git config --global --add safe.directory '*' || true"
- "name": "remove-workflows"
"run": "rm -f .github/workflows/*"
- "name": "generate-workflows"
"run": "jsonnet -m .github/workflows/ -S .github.jsonnet;"
- "name": "git workaround"
"run": "git config --global --add safe.directory $PWD"
- "name": "check-jsonnet-diff"
"run": "git diff --exit-code"
- "if": "failure()"
"name": "possible-causes-for-error"
"run": "echo \"Possible causes: \n1. You updated jsonnet files, but did not regenerate the workflows. \nTo fix, run 'yarn github:generate' locally and commit the changes. If this helps, check if your pre-commit hooks work.\n2. You used the wrong jsonnet binary. In this case, the newlines at the end of the files differ.\nTo fix, install the go binary. On mac, run 'brew uninstall jsonnet && brew install jsonnet-go'\""
"timeout-minutes": 30
"name": "misc"
"on":
- "pull_request"