You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# (1) Get the branch name of the PR that has been commented on with "/binder"
13
+
# (2) make a comment on the PR with the binder badge
14
+
- name: comment on PR with Binder link
15
+
uses: actions/github-script@v1
16
+
with:
17
+
github-token: ${{secrets.GITHUB_TOKEN}}
18
+
script: |
19
+
// Get the branch name
20
+
github.pulls.get({
21
+
owner: context.repo.owner,
22
+
repo: context.repo.repo,
23
+
pull_number: context.payload.issue.number
24
+
}).then( (pr) => {
25
+
26
+
// use the branch name to make a comment on the PR with a Binder badge
27
+
var BRANCH_NAME = pr.data.head.ref
28
+
github.issues.createComment({
29
+
issue_number: context.payload.issue.number,
30
+
owner: context.repo.owner,
31
+
repo: context.repo.repo,
32
+
body: `[](https://mybinder.org/v2/gh/${context.repo.owner}/${context.repo.repo}/${BRANCH_NAME}?urlpath=lab/tree/examples/demo.ipynb) :point_left: Launch a binder JupyterLab on this branch`
0 commit comments