Skip to content

Allow user to define their own xstartup file #64

Allow user to define their own xstartup file

Allow user to define their own xstartup file #64

Workflow file for this run

#./.github/workflows/binder-badge.yaml
name: Binder Badge
on: [pull_request_target]
jobs:
binder:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- name: comment on PR with Binder link
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
var PR_HEAD_SHA = process.env.PR_HEAD_SHA;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_SHA}?urlpath=desktop) :point_left: Launch a binder notebook on this branch for commit ${PR_HEAD_SHA}`
})
env:
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}