Update workflow to use artifact actions v4 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run InSpec Profile | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
my-job: | |
name: Validate my profile | |
runs-on: windows-2022 | |
env: | |
CHEF_LICENSE: accept-silent | |
steps: | |
- name: Check out code | |
uses: actions/checkout@master | |
- name: install chef | |
uses: actionshub/chef-install@main | |
- name: Check InSpec version | |
run: inspec version | |
- name: Run InSpec | |
run: 'inspec exec . --reporter=cli json:results.json || true' | |
- name: Display the results summary | |
uses: mitre/saf_action@v1 | |
with: | |
command_string: 'view summary -i results.json' | |
- name: Ensure the scan meets the results threshold | |
uses: mitre/saf_action@v1 | |
with: | |
command_string: 'validate threshold -i results.json -F threshold.yml' | |
- name: Save Test Result JSON | |
uses: actions/upload-artifact@v4 | |
with: | |
path: results.json |