Skip to content

Commit

Permalink
add notebooks label to pull requests when notebooks are modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Jan 19, 2024
1 parent 456c425 commit f8bf322
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# label rules used by .github/workflows/label.yml

# label 'ci' all automation-related steps and files
# Since this repository is in itself an automation process to deploy a server instance,
# we refer here to CI as the 'meta' configuration files for managing the code and integrations with the repository,
# not configurations related to the deployment process itself.

'notebooks':
- changed-files:
- any-glob-to-any-file:
- docs/notebooks/**/*.ipynb
36 changes: 36 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md

name: Labeler
on: [pull_request_target]
# Note: potential security risk from this action using pull_request_target.
# Do not add actions in here which need a checkout of the repo, and do not use any caching in here.
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target

permissions:
contents: read

jobs:
label:
name: Label
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
- uses: actions/labeler@v5.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
name: Test Notebooks
needs: lint
if: |
contains(github.event.pull_request.labels.*.name, 'notebooks') ||
contains(github.event.pull_request.labels.*.name, 'approved') ||
(github.event.review.state == 'approved') ||
(github.event_name == 'push')
Expand Down

0 comments on commit f8bf322

Please sign in to comment.