mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-09 03:50:45 +08:00
fd73915a59
* Update repo links to the jupyterlab org * Fix permissions for the binder workflow * Project Jupyter Contributors * Add community guidelines to the README
31 lines
1.0 KiB
YAML
31 lines
1.0 KiB
YAML
# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html
|
|
name: Binder Badge
|
|
on:
|
|
pull_request_target:
|
|
types: [opened]
|
|
|
|
permissions:
|
|
pull-requests:
|
|
write
|
|
|
|
jobs:
|
|
binder:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: comment on PR with Binder link
|
|
uses: actions/github-script@v3
|
|
with:
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
script: |
|
|
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
|
|
var PR_HEAD_REF = process.env.PR_HEAD_REF;
|
|
github.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_REF}?urlpath=retro/tree) :point_left: Launch RetroLab on Binder`
|
|
})
|
|
env:
|
|
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
|
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}
|