CI #45
This file contains hidden or 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
# | |
# Run CI tests | |
# | |
# Note: | |
# This workflow is designed to run only in Azure/PSRule.Rules.Azure-quickstart. | |
# You can safely deleted this file if you have templated this repository to your GitHub organization. | |
# For PSRule documentation see: | |
# https://aka.ms/ps-rule | |
# For action details see: | |
# https://aka.ms/ps-rule-action | |
name: CI | |
# Run for main or PRs against main | |
on: | |
push: | |
branches: [main, 'dependencies/*'] | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '54 20 * * 0' # At 08:54 PM, on Sunday each week | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
if: github.repository == 'Azure/PSRule.Rules.Azure-quickstart' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Check repository content | |
uses: microsoft/ps-rule@46451b8f5258c41beb5ae69ed7190ccbba84112c # v2.9.0 | |
with: | |
modules: PSRule.Rules.MSFT.OSS | |
- name: Check Azure samples | |
uses: microsoft/ps-rule@46451b8f5258c41beb5ae69ed7190ccbba84112c # v2.9.0 | |
with: | |
modules: PSRule.Rules.Azure | |
outputFormat: Sarif | |
outputPath: reports/ps-rule-results.sarif | |
summary: true | |
- name: Upload results to security tab | |
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 | |
if: always() | |
with: | |
sarif_file: reports/ps-rule-results.sarif | |
- name: Upload results | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
if: always() | |
with: | |
name: PSRule-Sarif | |
path: reports/ps-rule-results.sarif | |
retention-days: 1 | |
if-no-files-found: error |