Skip to content

Commit 1a3d7a5

Browse files
authored
Binder badge: use repo.full_name (#208)
GitHub Actor is the user that opened the PR, but this may not be the same as the owner of the fork. `pull_request.head.repo.full_name` should be the `owner/reponame` of the PR fork
1 parent 7604151 commit 1a3d7a5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

doc/howto/binder-badge.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ jobs:
1111
with:
1212
github-token: ${{secrets.GITHUB_TOKEN}}
1313
script: |
14-
var PR_HEAD_USER = process.env.GITHUB_ACTOR;
15-
var PR_HEAD_REPO = process.env.PR_HEAD_REPO;
14+
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
1615
var PR_HEAD_SHA = process.env.PR_HEAD_SHA;
1716
github.issues.createComment({
1817
issue_number: context.issue.number,
1918
owner: context.repo.owner,
2019
repo: context.repo.repo,
21-
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USER}/${PR_HEAD_REPO}/${PR_HEAD_SHA}) :point_left: Launch a binder notebook on this branch for commit ${PR_HEAD_SHA}`
20+
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_SHA}) :point_left: Launch a binder notebook on this branch for commit ${PR_HEAD_SHA}`
2221
})
2322
env:
2423
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
25-
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.name }}
24+
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}

0 commit comments

Comments
 (0)