Repository navigation
ci: bump gosec to v2.28.0, retire obsolete #nosec suppressions (closes #1382) #1974
Workflow file for this run
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
| name: Azure Sanity (Read-only Dry Run) | |
| on: | |
| pull_request: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| sanity: | |
| runs-on: ubuntu-latest | |
| env: | |
| REPORT_PATH: azure_sanity_report.json | |
| steps: | |
| - name: Precheck secrets (skip if not configured) | |
| id: precheck | |
| shell: bash | |
| env: | |
| AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| run: | | |
| if [[ -z "${AZURE_CLIENT_ID}" || -z "${AZURE_TENANT_ID}" || -z "${AZURE_SUBSCRIPTION_ID}" ]]; then | |
| echo "should_run=false" >> "$GITHUB_OUTPUT" | |
| echo "Missing Azure secrets. Skipping Azure sanity." | |
| else | |
| echo "should_run=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Checkout | |
| if: steps.precheck.outputs.should_run == 'true' | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - name: Setup Go | |
| if: steps.precheck.outputs.should_run == 'true' | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Azure Login (OIDC) | |
| if: steps.precheck.outputs.should_run == 'true' | |
| uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 | |
| with: | |
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| - name: Build + Run Azure sanity | |
| if: steps.precheck.outputs.should_run == 'true' | |
| env: | |
| AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| run: | | |
| go test ./ci_cd_sanity_tests/... -count=1 | |
| go build -o azure-sanity ./ci_cd_sanity_tests/cmd/azure_sanity | |
| ./azure-sanity \ | |
| --subscription-id "${AZURE_SUBSCRIPTION_ID}" \ | |
| --expected-subscription "${AZURE_SUBSCRIPTION_ID}" \ | |
| --expected-tenant "${AZURE_TENANT_ID}" \ | |
| --out "${REPORT_PATH}" | |
| - name: Upload report artifact | |
| if: always() && steps.precheck.outputs.should_run == 'true' | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: azure-sanity-report | |
| path: ${{ env.REPORT_PATH }} | |
| if-no-files-found: ignore | |
| - name: Skipped summary | |
| if: steps.precheck.outputs.should_run != 'true' | |
| run: echo "Azure sanity skipped because required secrets are not configured." |