Skip to content

Commit 2da7195

Browse files
authored
[repo] GitHub Actions hardening (open-telemetry#2671)
1 parent 3698be9 commit 2da7195

17 files changed

+38
-38
lines changed

.github/workflows/Component.BuildTest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
runs-on: ${{ matrix.os }}
5555

5656
steps:
57-
- uses: actions/checkout@v4
57+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5858
with:
5959
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
6060
# the version tag which is typically NOT on the first commit so we
@@ -89,7 +89,7 @@ jobs:
8989
echo "BUILD_COMPONENT=$component" >> $env:GITHUB_ENV
9090
9191
- name: Setup dotnet
92-
uses: actions/setup-dotnet@v4
92+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
9393

9494
- name: dotnet restore ${{ steps.resolve-project.outputs.title }}
9595
run: dotnet restore ${{ steps.resolve-project.outputs.project }} -p:EnablePackageValidation=true
@@ -127,7 +127,7 @@ jobs:
127127

128128
- name: Upload code coverage ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
129129
if: ${{ inputs.run-tests && hashFiles('./TestResults/Cobertura.xml') != '' }}
130-
uses: codecov/codecov-action@v5
130+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
131131
continue-on-error: true # Note: Don't fail for upload failures
132132
env:
133133
OS: ${{ matrix.os }}

.github/workflows/add-labels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: check out code
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222

2323
- name: Add labels for component found in bug issue descriptions
2424
shell: pwsh
@@ -40,7 +40,7 @@ jobs:
4040

4141
steps:
4242
- name: check out code
43-
uses: actions/checkout@v4
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4444
with:
4545
ref: ${{ github.event.repository.default_branch }} # Note: Do not run on the PR branch we want to execute add-labels.psm1 from main on the base repo only because pull_request_target can see secrets
4646

.github/workflows/assign-reviewers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
name: Assign Reviewers
1212
steps:
13-
- uses: dyladan/component-owners@main
13+
- uses: dyladan/component-owners@58bd86e9814d23f1525d0a970682cead459fa783 # v0.1.0
1414
with:
1515
assign-owners: ${{ github.event.pull_request.draft == false }}

.github/workflows/ci-Exporter.OneCollector-Integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636

3737
runs-on: ${{ matrix.os }}
3838
steps:
39-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4040
with:
4141
ref: ${{ github.event.pull_request.head.sha || github.ref }} # Run on the fork branch once approved
4242

4343
- name: Setup dotnet
44-
uses: actions/setup-dotnet@v4
44+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
4545

4646
- name: dotnet restore Component.proj for OpenTelemetry.Exporter.OneCollector
4747
run: dotnet restore build/Projects/Component.proj -p:BUILD_COMPONENT=OpenTelemetry.Exporter.OneCollector

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
outputs:
1414
changes: ${{ steps.changes.outputs.changes }}
1515
steps:
16-
- uses: AurorNZ/paths-filter@v4
16+
- uses: AurorNZ/paths-filter@3b1f3abc3371cca888d8eb03dfa70bc8a9867629 # v4.0.0
1717
id: changes
1818
with:
1919
filters: |

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@ jobs:
2222

2323
steps:
2424
- name: configure Pagefile
25-
uses: al-cheb/[email protected]
25+
uses: al-cheb/configure-pagefile-action@a3b6ebd6b634da88790d9c58d4b37a7f4a7b8708 # v1.4
2626
with:
2727
minimum-size: 8GB
2828
maximum-size: 32GB
2929
disk-root: "D:"
3030

3131
- name: Checkout repository
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3333

3434
- name: Initialize CodeQL
35-
uses: github/codeql-action/init@v3
35+
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
3636
with:
3737
languages: ${{ matrix.language }}
3838

3939
- name: Setup dotnet
40-
uses: actions/setup-dotnet@v4
40+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
4141

4242
- name: dotnet pack opentelemetry-dotnet-contrib.proj
4343
run: dotnet pack opentelemetry-dotnet-contrib.proj --configuration Release
4444

4545
- name: Perform CodeQL Analysis
46-
uses: github/codeql-action/analyze@v3
46+
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13

.github/workflows/core-version-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}
2525

2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
with:
2929
ref: ${{ github.event.repository.default_branch }}
3030
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}
3131

3232
- name: Setup dotnet
33-
uses: actions/setup-dotnet@v4
33+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
3434

3535
- name: Create GitHub Pull Request to update core version in props and update CHANGELOGs in projects
3636
shell: pwsh

.github/workflows/dotnet-format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99

1010
steps:
1111
- name: check out code
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1313

1414
- name: Setup dotnet
15-
uses: actions/setup-dotnet@v4
15+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
1616

1717
- name: dotnet restore
1818
run: dotnet restore

.github/workflows/integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
version: [net8.0]
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2020

2121
- name: Run redis docker compose
2222
run: docker compose --file=test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
@@ -29,7 +29,7 @@ jobs:
2929
matrix:
3030
version: [net8.0]
3131
steps:
32-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3333

3434
- name: Run kafka docker compose
3535
run: docker compose --file=test/OpenTelemetry.Instrumentation.ConfluentKafka.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build

.github/workflows/markdownlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99

1010
steps:
1111
- name: check out code
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1313

1414
- name: run markdownlint
15-
uses: DavidAnson/[email protected]
15+
uses: DavidAnson/markdownlint-cli2-action@05f32210e84442804257b2a6f20b273450ec8265 # v19.1.0
1616
with:
1717
globs: |
1818
**/*.md

0 commit comments

Comments
 (0)