Skip to content

Commit a67cae6

Browse files
committed
Added CI to detect new notebooks
1 parent d1baa76 commit a67cae6

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Detect New Notebooks in PR"
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
detect-and-respond:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Get newly added notebooks
21+
id: changed-files
22+
uses: tj-actions/changed-files@v46.0.1
23+
with:
24+
files: |
25+
**/*.ipynb
26+
27+
- name: Add 'new notebook' label
28+
if: ${{ steps.changed-files.outputs.added_files_count != '0' }}
29+
uses: actions-ecosystem/action-add-labels@v1
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
labels: new notebook
33+
34+
- name: Comment on PR
35+
if: ${{ steps.changed-files.outputs.added_files_count != '0' }}
36+
uses: marocchino/sticky-pull-request-comment@v2
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
header: new-notebook-alert
40+
message: |
41+
🔥 New notebook just dropped!
42+
43+
@amir-naveh , @TomerGoldfriend — come check out this shiny new addition to our repo.

0 commit comments

Comments
 (0)