Skip to content

Commit

Permalink
Merge pull request #185 from nais/action-test
Browse files Browse the repository at this point in the history
fix(deploy-action): improve masking logic and error message
  • Loading branch information
jhrv authored Dec 19, 2023
2 parents 69b2c24 + c37fdcc commit 59f3081
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion actions/deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM europe-north1-docker.pkg.dev/nais-io/nais/images/deploy-action:2023-12-14-214339-87d3cc2
FROM europe-north1-docker.pkg.dev/nais-io/nais/images/deploy-action:2023-12-19
7 changes: 6 additions & 1 deletion actions/deploy/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
if [ -n "$APIKEY" ]; then
echo "::add-mask::$APIKEY"
fi
if [ -n "$ACTIONS_ID_TOKEN_REQUEST_TOKEN" ]; then
echo "::add-mask::$ACTIONS_ID_TOKEN_REQUEST_TOKEN"
fi

if [ -z "$OWNER" ]; then
OWNER=$(echo "$GITHUB_REPOSITORY" | cut -f1 -d/)
Expand Down Expand Up @@ -41,7 +44,9 @@ fi
# if no apikey is set, use use the id-token to get a jwt token for the deploy CLI
if [ -z "$APIKEY" ]; then
if [ -z "$ACTIONS_ID_TOKEN_REQUEST_TOKEN" ] || [ -z "$ACTIONS_ID_TOKEN_REQUEST_URL" ]; then
echo "APIKEY or id-token permissions must be set"
echo "Missing id-token permissions. This must be set either globally in the workflow, or for the specific job performing the deploy."
echo "For more info see https://doc.nais.io/deployment/github-action/ and/or https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs"

exit 1
fi

Expand Down

0 comments on commit 59f3081

Please sign in to comment.