Skip to content

Commit f75371b

Browse files
Use gh api to call GitHub API to add auth header
1 parent c42c7e3 commit f75371b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ jobs:
8989
steps:
9090
- uses: actions/checkout@v3
9191
- run: rake ci:pin_build_manifest
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9294
- uses: actions/upload-artifact@v3
9395
with:
9496
name: build-manifest

tasks/ci.rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ def latest_build_sources
33
.map do |name, src|
44
case src[:type]
55
when "github"
6-
url = "https://api.github.com/repos/#{src[:repo]}/commits/#{src[:rev]}"
7-
revision = OpenURI.open_uri(url) { |f| JSON.load(f.read) }
6+
url = "repos/#{src[:repo]}/commits/#{src[:rev]}"
7+
revision = JSON.parse(`gh api #{url}`)
88
[name, revision["sha"]]
99
else
1010
raise "#{src[:type]} is not supported to pin source revision"

0 commit comments

Comments
 (0)