generated from uwhackweek/docker-template
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 1.06 KB
/
PRbadge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: AddBinderBadge
on:
pull_request_target:
branches:
- main
types: [opened]
paths-ignore:
- 'LICENSE'
- 'README.md'
- '.gitignore'
jobs:
build-image-without-pushing:
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v3
- name: Comment on PR with Binder link
uses: actions/github-script@v3
env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
CONTENT_REPO: ${{ github.event.pull_request.head.repo.full_name }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
var BRANCH_NAME = process.env.BRANCH_NAME;
var CONTENT_REPO = process.env.CONTENT_REPO;
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/${CONTENT_REPO}/${BRANCH_NAME}?urlpath=lab) :point_left: Launch a binder notebook on this branch`
})