Skip to content

Commit

Permalink
some CI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Feb 26, 2023
1 parent dc93d14 commit 8efeeb4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/badges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Badges

# TODO: restore
# on:
# pull_request_target:
# types: [opened]

on:
push:
branches:
- main
pull_request:
branches:
- '*'

permissions:
pull-requests: write

jobs:
binder:
runs-on: ubuntu-latest
steps:
- name: Add Demo comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const PR_NUMBER = context.issue.number
const { PR_HEAD_REF, PR_HEAD_USERREPO } = process.env;
const LITE = `https://jupyterlite.rtfd.io/en/latest/_static/badge.svg`;
const BND = `https://mybinder.org/badge_logo.svg`;
const RTD = `https://jupyterlab-deck--${PR_NUMBER}.org.readthedocs.build/en/${PR_NUMBER}/_static/lab/index.html?path=README.ipynb`;
const BH = `https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=lab/tree/examples/README.ipynb`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Try it on [![](${LITE})](${RTD}) :arrow_left: ReadTheDocs or Binder :arrow_right: [![](${BND})](${BH})`
});
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pages
name: Pages

on:
push:
Expand Down

0 comments on commit 8efeeb4

Please sign in to comment.