-
Notifications
You must be signed in to change notification settings - Fork 77
61 lines (56 loc) · 1.48 KB
/
lint-spell.yaml
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
53
54
55
56
57
58
59
60
61
name: Lint Code Spell
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
push:
branches:
- main
- release-*
- github_pages
workflow_call:
inputs:
ref:
required: true
type: string
workflow_dispatch:
inputs:
ref:
description: 'sha, tag, branch'
required: true
default: main
jobs:
lint_spell:
runs-on: ubuntu-latest
steps:
- name: Get Ref
id: get_ref
run: |
if ${{ inputs.ref != '' }} ; then
echo "trigger by workflow_call"
echo "ref=${{ inputs.ref }}" >> $GITHUB_ENV
elif ${{ github.event_name == 'workflow_dispatch' }} ; then
echo "trigger by workflow_dispatch"
echo "ref=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
elif ${{ github.event_name == 'push' }} ; then
echo "trigger by push"
echo "ref=${{ github.sha }}" >> $GITHUB_ENV
else
echo "trigger by ${{ github.event_name }}"
echo "ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
fi
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.ref }}
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.8
architecture: x64
- name: Run Code Lint
run: |
make lint-code-spell