We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7360c40 commit cb70cdcCopy full SHA for cb70cdc
1 file changed
prepare-custom-p2/action.yml
@@ -25,11 +25,18 @@ runs:
25
shell: bash
26
env:
27
REPO: ${{ inputs.repo }}
28
+ GITHUB_TOKEN: ${{ inputs.token }}
29
run: |
30
uri_encoded_branch_name=$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$GITHUB_HEAD_REF")
31
echo "uri_encoded_branch_name=$uri_encoded_branch_name"
32
+ if [ -z "$GITHUB_TOKEN" ]; then
33
+ AUTH_HEADER=""
34
+ else
35
+ AUTH_HEADER="-H Authorization: token $GITHUB_TOKEN"
36
+ fi
37
http_status=$(curl -s -o /dev/null -w "%{http_code}" \
38
-H "Accept: application/vnd.github.v3+json" \
39
+ "$AUTH_HEADER"
40
"https://api.github.com/repos/$GITHUB_REPOSITORY_OWNER/$REPO/branches/$uri_encoded_branch_name")
41
echo "httpstatus=$http_status"
42
if [ "$http_status" = '200' ]; then
0 commit comments