-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
37 lines (37 loc) · 1.14 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
name: pre-commit-conda
description: run pre-commit
inputs:
extra-args:
description: options to pass to pre-commit run
required: false
default: '--all-files'
condarc-file:
description: path to a custom condarc file
required: false
default: ''
python-version:
description: python version to use
required: false
default: '3.11'
runs:
using: composite
steps:
- name: Set up micromamba
uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc
with:
condarc-file: ${{ inputs.condarc-file }}
environment-name: pre-commit
cache-environment-key: pre-commit-3|${{ inputs.python-version }}
create-args: >-
python=${{ inputs.python-version }}
pre-commit=3
- name: Cache pre-commit
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ inputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always ${{ inputs.extra-args }}
env:
PRE_COMMIT_USE_MICROMAMBA: '1'
shell: bash -el {0}