Skip to content

Commit

Permalink
Add github builtin authorization to support private repos (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
fiskhest authored Mar 21, 2022
1 parent 3a2fcc7 commit 616a964
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ runs:
url="${GITHUB_API_URL}/repos"
repo="${GITHUB_REPOSITORY}"
run_id="${GITHUB_RUN_ID}"
token="${{ github.token }}"
failure=$(curl -s "${url}/${repo}/actions/runs/${run_id}/jobs" | \
failure=$(curl -s -H "Authorization: token ${token}" "${url}/${repo}/actions/runs/${run_id}/jobs" | \
jq -r '.jobs[] | select(.status == "completed" and .conclusion == "failure").conclusion' | \
wc -l)
cancelled=$(curl -s "${url}/${repo}/actions/runs/${run_id}/jobs" | \
cancelled=$(curl -s -H "Authorization: token ${token}" "${url}/${repo}/actions/runs/${run_id}/jobs" | \
jq -r '.jobs[] | select(.status == "completed" and .conclusion == "cancelled").conclusion' | \
wc -l)
Expand All @@ -35,4 +36,4 @@ runs:
shell: bash
branding:
icon: check-square
color: gray-dark
color: gray-dark

0 comments on commit 616a964

Please sign in to comment.