-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (47 loc) · 1.44 KB
/
lint-profile.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
name: Lint & Check the Profile
on:
pull_request:
push:
branches:
- main
jobs:
validate:
name: Lint
runs-on: ubuntu-latest
env:
CHEF_LICENSE: accept-silent
CHEF_LICENSE_KEY: ${{ secrets.SAF_CHEF_LICENSE_KEY }}
KITCHEN_LOCAL_YAML: kitchen.ec2.yml
LC_ALL: "en_US.UTF-8"
steps:
- name: add needed packages
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Check out repository
uses: actions/checkout@v4
- name: Clone full repository so we can push
run: git fetch --prune --unshallow
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Confirm git commit SHA output
run: echo ${{ env.COMMIT_SHORT_SHA }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
- name: Disable ri and rdoc
run: 'echo "gem: --no-ri --no-rdoc" >> ~/.gemrc'
- name: Run Bundle Install
run: bundle install
- name: Installed Inspec
run: bundle exec inspec version
- name: Vendor the Profile
run: bundle exec inspec vendor . --overwrite
- name: Check the Inspec profile
run: bundle exec rake inspec:check
- name: Lint the Profile
run: bundle exec rake lint