-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
50 lines (47 loc) · 1.6 KB
/
action.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: nblint
description: Lint jupyter notebooks to ensure proper formatting
inputs:
directory:
description: Directory to search for notebooks
required: false
default: '.'
ignore_paths:
description: Comma-seperated list of paths to ignore, paths should be relative to the directory specified above
required: false
default: ''
check_outputs_empty:
description: Check that output cell are empty
required: false
default: true
check_no_trailing_newline:
description: Check that there is no newline at the end of code cells
required: false
default: true
check_correct_kernel:
description: Check that notebook is using the right kernel
required: false
default: false
check_notebook_badge:
description: Check that notebook has a google colab badge
required: false
default: false
runs:
using: "composite"
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Dependencies
run: pip install -r '${{ github.action_path }}/requirements.txt'
shell: bash
- name: Run nblint script
run: python '${{ github.action_path }}/src/nblint.py'
shell: bash
env:
INPUT_DIRECTORY: ${{ inputs.directory }}
INPUT_IGNORE_PATHS: ${{ inputs.ignore_paths }}
INPUT_CHECK_OUTPUTS_EMPTY: ${{ inputs.check_outputs_empty }}
INPUT_CHECK_NO_TRAILING_NEWLINE: ${{ inputs.check_no_trailing_newline }}
INPUT_CHECK_CORRECT_KERNEL: ${{ inputs.check_correct_kernel }}
INPUT_CHECK_NOTEBOOK_BADGE: ${{ inputs.check_notebook_badge }}