forked from cisagov/LME
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (81 loc) · 2.46 KB
/
main.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
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
on:
workflow_dispatch:
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*' # match basic semver tags
pull_request:
branches:
- main
- 'release-*'
jobs:
#pullrequest_opened:
# name: pullrequest_opened
# runs-on: ubuntu-latest
# if: |
# contains(github.event.pull_request.labels.*.name, 'feat') ||
# contains(github.event.pull_request.labels.*.name, 'update') ||
# contains(github.event.pull_request.labels.*.name, 'fix')
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint Shell Scripts
continue-on-error: true
run: |
sudo apt-get update
sudo apt-get install shellcheck
shellcheck **/*.sh
- name: Lint PowerShell Scripts
continue-on-error: true
run: |
pwsh -Command "Invoke-ScriptAnalyzer -EnableExit -Recurse -Path ."
- name: Lint Lua
continue-on-error: true
run: |
sudo apt-get install -y luarocks
sudo luarocks install luacheck
luacheck **/*.lua
- name: Lint TeX Files
continue-on-error: true
run: |
sudo apt-get install chktex
chktex **/*.tex
- name: Lint YAML Files
continue-on-error: true
run: |
sudo apt-get update
sudo apt-get install yamllint
yamllint -f parsable **/*.yml
semgrep-scan:
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Semgrep Scan
continue-on-error: true
run: |
semgrep --config "p/r2c" .
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [lint, semgrep-scan]
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up tag name
id: tag
run: echo "::set-output name=tag::${GITHUB_REF##*/}"
- name: Build
run: git ls-files | zip release-${{ steps.tag.outputs.tag }}.zip -@
- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: release-${{ steps.tag.outputs.tag }}.zip
draft: true
generate_release_notes: true
fail_on_unmatched_files: true