Skip to content

Commit 92aa952

Browse files
committed
Fix CodeBoarding app credential detection lint
1 parent 4076156 commit 92aa952

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/codeboarding.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
APP_ID: ${{ vars.CODEBOARDING_APP_ID }}
4545
PRIVATE_KEY: ${{ secrets.CODEBOARDING_APP_PRIVATE_KEY }}
4646
run: |
47-
client_id="$CLIENT_ID"
48-
app_id="$APP_ID"
47+
client_id="${CLIENT_ID:-}"
48+
app_id="${APP_ID:-}"
4949
5050
# GitHub App client IDs start with "Iv". If that value was stored in
5151
# CODEBOARDING_APP_ID, use it as a client ID to avoid the deprecated
@@ -64,16 +64,18 @@ jobs:
6464
else
6565
echo "::warning::CODEBOARDING_APP_PRIVATE_KEY is not a valid PEM private key, so CodeBoarding will fall back to github-actions[bot]."
6666
if printf '%b' "$PRIVATE_KEY" | openssl pkey -noout >/dev/null 2>&1; then
67-
echo "::warning::CODEBOARDING_APP_PRIVATE_KEY looks like it contains literal \\n escapes. Store the downloaded PEM as multi-line secret text instead."
67+
printf '%s\n' "::warning::CODEBOARDING_APP_PRIVATE_KEY looks like it contains literal \\n escapes. Store the downloaded PEM as multi-line secret text instead."
6868
fi
6969
fi
7070
fi
7171
72-
[ -n "$client_id" ] && echo "has_client_id=true" >> "$GITHUB_OUTPUT" || echo "has_client_id=false" >> "$GITHUB_OUTPUT"
73-
[ -n "$app_id" ] && echo "has_app_id=true" >> "$GITHUB_OUTPUT" || echo "has_app_id=false" >> "$GITHUB_OUTPUT"
74-
echo "client_id=$client_id" >> "$GITHUB_OUTPUT"
75-
echo "has_private_key=$has_private_key" >> "$GITHUB_OUTPUT"
76-
echo "private_key_valid=$private_key_valid" >> "$GITHUB_OUTPUT"
72+
{
73+
[ -n "$client_id" ] && echo "has_client_id=true" || echo "has_client_id=false"
74+
[ -n "$app_id" ] && echo "has_app_id=true" || echo "has_app_id=false"
75+
echo "client_id=$client_id"
76+
echo "has_private_key=$has_private_key"
77+
echo "private_key_valid=$private_key_valid"
78+
} >> "$GITHUB_OUTPUT"
7779
- uses: actions/create-github-app-token@v3
7880
id: codeboarding-app-token-client
7981
if: steps.codeboarding-app-config.outputs.has_client_id == 'true' && steps.codeboarding-app-config.outputs.private_key_valid == 'true'

0 commit comments

Comments
 (0)