Skip to content

Commit f94573a

Browse files
authored
Create puppet-lint.yml
1 parent 0488872 commit f94573a

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/puppet-lint.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# Puppet Lint tests Puppet code against the recommended Puppet language style guide.
6+
# https://puppet.com/docs/puppet/7/style_guide.html
7+
# Puppet Lint validates only code style; it does not validate syntax.
8+
# To test syntax, use Puppet's puppet parser validate command.
9+
# More details at https://github.com/puppetlabs/puppet-lint/
10+
11+
name: puppet-lint
12+
13+
on:
14+
push:
15+
branches: [ "main" ]
16+
pull_request:
17+
# The branches below must be a subset of the branches above
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '36 10 * * 4'
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
puppet-lint:
27+
name: Run puppet-lint scanning
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read # for checkout to fetch code
31+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
32+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v3
37+
38+
- name: Setup Ruby
39+
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
40+
with:
41+
ruby-version: 2.7
42+
bundler-cache: true
43+
44+
- name: Install puppet-lint
45+
run: gem install puppet-lint
46+
47+
- name: Run puppet-lint
48+
run: puppet-lint . --sarif > puppet-lint-results.sarif
49+
continue-on-error: true
50+
51+
- name: Upload analysis results to GitHub
52+
uses: github/codeql-action/upload-sarif@v2
53+
with:
54+
sarif_file: puppet-lint-results.sarif
55+
wait-for-processing: true

0 commit comments

Comments
 (0)