forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (89 loc) · 2.67 KB
/
bash_code_analysis.yaml
File metadata and controls
103 lines (89 loc) · 2.67 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: bash_code_analysis
on:
push:
branches:
- develop
pull_request_target: # safe as long as code is not being run
workflow_dispatch:
jobs:
shfmt:
runs-on: ubuntu-22.04
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: write # to get PR metadata
security-events: write
checks: write
steps:
- name: determine hash
uses: haya14busa/action-cond@v1
id: hash
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.sha }}
if_false: ''
- name: checkout code
uses: actions/checkout@v6
with:
ref: ${{ steps.hash.outputs.value }}
submodules: false
- name: determine reporter
uses: haya14busa/action-cond@v1
id: reporter
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: 'github-pr-review'
if_false: 'github-check'
- name: shfmt scan
uses: reviewdog/action-shfmt@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
filter_mode: nofilter
level: any
reviewdog_flags: '-reporter=${{ steps.reporter.outputs.value }} -fail-level=any'
shfmt_flags: ''
shellcheck:
runs-on: ubuntu-22.04
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: write # to get PR metadata
security-events: write
checks: write
steps:
- name: determine hash
uses: haya14busa/action-cond@v1
id: hash
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.sha }}
if_false: ''
- name: checkout code
uses: actions/checkout@v6
with:
ref: ${{ steps.hash.outputs.value }}
submodules: false
- name: determine reporter
uses: haya14busa/action-cond@v1
id: reporter
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: 'github-pr-review'
if_false: 'github-check'
- name: shellcheck scan
uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: ${{ steps.reporter.outputs.value }}
filter_mode: nofilter
fail_level: any
level: any
pattern: |
config.*
JG*
*.env
*.sh
*.bash
exclude: |
*/.git/*
*/*.yml
*/*.yaml
check_all_files_with_shebangs: true