Skip to content

Commit

Permalink
use of github_token
Browse files Browse the repository at this point in the history
  • Loading branch information
sabban committed Apr 25, 2024
1 parent bfdf876 commit e6fccba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/populate-hapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ jobs:
- name: Fetch all commit details
if: ${{ ! github.event.created }}
id: fetch-commits
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
TOKEN=$GITHUB_TOKEN
URL=$(jq -r '.repository.commits_url' $GITHUB_EVENT_PATH | sed 's/{\/sha}//')
COMMITS=""
PAGE=1
curl -sSL -H "Authorization: token $TOKEN" "$URL?page=$PAGE&per_page=100"
curl -sSL -H "Authorization: token $GITHUB_TOKEN" "$URL?page=$PAGE&per_page=100"
while true; do
PAGE_COMMITS=$(curl -sSL -H "Authorization: token $TOKEN" "$URL?page=$PAGE&per_page=100" | jq -r '.[].sha')
PAGE_COMMITS=$(curl -sSL -H "Authorization: token $GITHUB_TOKEN" "$URL?page=$PAGE&per_page=100" | jq -r '.[].sha')
if [ -z "$PAGE_COMMITS" ]; then
break
fi
Expand Down

0 comments on commit e6fccba

Please sign in to comment.