-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[release/v7.4.15] [StepSecurity] ci: Harden GitHub Actions tags #27243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,8 @@ on: | |
| - github-mirror | ||
| paths: | ||
| - "**" | ||
| - "*" | ||
| - ".globalconfig" | ||
| - "!.github/ISSUE_TEMPLATE/**" | ||
| - "!.dependabot/config.yml" | ||
| - "!.pipelines/**" | ||
|
|
@@ -25,12 +27,12 @@ on: | |
| # Path filters for PRs need to go into the changes job | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ contains(github.ref, 'merge')}} | ||
|
|
||
| env: | ||
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | ||
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | ||
| DOTNET_NOLOGO: 1 | ||
| FORCE_FEATURE: 'False' | ||
| FORCE_PACKAGE: 'False' | ||
| NUGET_KEY: none | ||
|
|
@@ -55,7 +57,7 @@ jobs: | |
| packagingChanged: ${{ steps.filter.outputs.packagingChanged }} | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
|
|
@@ -74,7 +76,7 @@ jobs: | |
| contents: read | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Check for merge conflict markers | ||
| uses: "./.github/actions/infrastructure/merge-conflict-checker" | ||
|
|
@@ -86,7 +88,7 @@ jobs: | |
| if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }} | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v4.1.0 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 1000 | ||
|
|
||
|
|
@@ -101,14 +103,15 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v4.1.0 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 1000 | ||
| - name: Linux Unelevated CI | ||
| uses: "./.github/actions/test/nix" | ||
| with: | ||
| purpose: UnelevatedPesterTests | ||
| tagSet: CI | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
Comment on lines
110
to
+114
|
||
| linux_test_elevated_ci: | ||
| name: Linux Elevated CI | ||
| needs: | ||
|
|
@@ -118,14 +121,15 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v4.1.0 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 1000 | ||
| - name: Linux Elevated CI | ||
| uses: "./.github/actions/test/nix" | ||
| with: | ||
| purpose: ElevatedPesterTests | ||
| tagSet: CI | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
Comment on lines
128
to
+132
|
||
| linux_test_unelevated_others: | ||
| name: Linux Unelevated Others | ||
| needs: | ||
|
|
@@ -135,14 +139,15 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v4.1.0 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 1000 | ||
| - name: Linux Unelevated Others | ||
| uses: "./.github/actions/test/nix" | ||
| with: | ||
| purpose: UnelevatedPesterTests | ||
| tagSet: Others | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
Comment on lines
146
to
+150
|
||
| linux_test_elevated_others: | ||
| name: Linux Elevated Others | ||
| needs: | ||
|
|
@@ -152,42 +157,31 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v4.1.0 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 1000 | ||
| - name: Linux Elevated Others | ||
| uses: "./.github/actions/test/nix" | ||
| with: | ||
| purpose: ElevatedPesterTests | ||
| tagSet: Others | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
Comment on lines
164
to
+168
|
||
| xunit_tests: | ||
| name: xUnit Tests | ||
| needs: | ||
| - changes | ||
| if: ${{ needs.changes.outputs.source == 'true' }} | ||
| if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }} | ||
| uses: ./.github/workflows/xunit-tests.yml | ||
| with: | ||
| runner_os: ubuntu-latest | ||
| test_results_artifact_name: testResults-xunit | ||
|
|
||
| analyze: | ||
| name: CodeQL Analysis | ||
| needs: changes | ||
| if: ${{ needs.changes.outputs.source == 'true' }} | ||
| uses: ./.github/workflows/analyze-reusable.yml | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
| with: | ||
| runner_os: ubuntu-latest | ||
|
|
||
| infrastructure_tests: | ||
| name: Infrastructure Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
|
|
@@ -245,24 +239,23 @@ jobs: | |
| - linux_test_elevated_others | ||
| - linux_test_unelevated_ci | ||
| - linux_test_unelevated_others | ||
| - analyze | ||
| - linux_packaging | ||
| - merge_conflict_check | ||
| - infrastructure_tests | ||
| # - analyze | ||
|
Comment on lines
241
to
+245
|
||
| if: always() | ||
| uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0 | ||
| with: | ||
| needs_context: ${{ toJson(needs) }} | ||
| linux_packaging: | ||
| name: Linux Packaging | ||
| needs: | ||
| - ci_build | ||
| - changes | ||
| if: ${{ needs.changes.outputs.packagingChanged == 'true' }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Linux Packaging | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file pins
upload-artifact, but it still uses an unpinned tag (actions/download-artifact@v4) earlier in the workflow. Since the PR goal is to harden/pin action refs, consider pinning thedownload-artifactreference to an immutable SHA as well for consistency.