Repository navigation
52 lines (49 loc) · 1.81 KB
/
Copy pathcheck-exercise-background.yml
File metadata and controls
52 lines (49 loc) · 1.81 KB
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
51
52
name: Check exercise background (reusable)
on:
workflow_call:
inputs:
runs-on:
description: >-
Runner label for the job. Use a self-hosted label only for a
private repository; never for a public one, whose pull requests
can run arbitrary code on it.
type: string
default: ''
python-version:
description: Python version to set up.
type: string
default: '3.x'
whole-tree:
description: Scan every tracked matching file in full, not only added lines.
type: boolean
default: false
globs:
description: Space-separated git pathspecs of tracked files to check.
type: string
default: '*.qmd'
fail:
description: Fail the workflow on a finding (else warnings only).
type: boolean
default: false
jobs:
check-exercise-background:
runs-on: ${{ inputs.runs-on || (github.event.repository.private && vars.CI_RUNNER) || 'ubuntu-latest' }}
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Full history so PR runs can diff added lines against the base.
fetch-depth: 0
- name: Check exercise background
uses: Morrison-Lab/gha/check-exercise-background@v3
with:
python-version: ${{ inputs.python-version }}
whole-tree: ${{ inputs.whole-tree }}
globs: ${{ inputs.globs }}
fail: ${{ inputs.fail }}
# On pull_request, HEAD^1 is the base tip GitHub built the merge ref on
# (see check-one-div-per-subfile, gha#1007); on push there is no base.
base-ref: ${{ github.event_name == 'pull_request' && 'HEAD^1' || '' }}