Skip to content

Commit f105b8a

Browse files
nogatesclaude
andauthored
Pin reusable workflow actions to full commit SHAs (#3902)
* Pin reusable workflow actions to full commit SHAs datadog-api-spec enforces a policy requiring all actions to be pinned to full commit SHAs; tag references like @v3/@v4 are rejected at job setup, causing all test jobs to fail. * Pin post-status-check action in test.yml to full commit SHA Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6a05bef commit f105b8a

7 files changed

Lines changed: 20 additions & 20 deletions

File tree

.github/workflows/reusable-examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
examples:
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2727
with:
2828
repository: DataDog/datadog-api-client-java
2929
ref: ${{ inputs.target-branch || github.ref }}
3030
- name: Install Java
31-
uses: actions/setup-java@v3
31+
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
3232
with:
3333
java-version: ${{ inputs.java-version }}
3434
distribution: "temurin"

.github/workflows/reusable-integration-test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,26 +89,26 @@ jobs:
8989
scope: DataDog/datadog-api-spec
9090
policy: datadog-api-client-java.reusable-integration-test.post-status
9191
- name: Checkout code
92-
uses: actions/checkout@v3
92+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9393
with:
9494
repository: DataDog/datadog-api-client-java
9595
ref: ${{ inputs.target-branch || github.ref }}
9696
- name: Post pending status check
9797
if: github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/') && (inputs.enable-status-reporting || github.event_name != 'workflow_call')
98-
uses: DataDog/github-actions/post-status-check@v2
98+
uses: DataDog/github-actions/post-status-check@65b4875f33ad773d7ba4b005a2cb5f35020295f3 # v2.3.0
9999
with:
100100
github-token: ${{ steps.get_token.outputs.token }}
101101
repo: ${{ inputs.target-repo || 'datadog-api-spec' }}
102102
status: pending
103103
context: ${{ inputs.status-context || 'integration' }}
104104
- name: Install Java
105-
uses: actions/setup-java@v3
105+
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
106106
with:
107107
java-version: '16'
108108
distribution: 'temurin'
109109
cache: 'maven'
110110
- name: Configure Datadog Test Optimization
111-
uses: datadog/test-visibility-github-action@v2
111+
uses: datadog/test-visibility-github-action@4e7afb05b464fd349275e41e65a7f4de83e7f46b # v2.10.0
112112
with:
113113
languages: java
114114
api_key: ${{ secrets.DD_API_KEY }}
@@ -128,15 +128,15 @@ jobs:
128128
SLEEP_AFTER_REQUEST: "${{ vars.SLEEP_AFTER_REQUEST }}"
129129
- name: Post failure status check
130130
if: failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/') && (inputs.enable-status-reporting || github.event_name != 'workflow_call')
131-
uses: DataDog/github-actions/post-status-check@v2
131+
uses: DataDog/github-actions/post-status-check@65b4875f33ad773d7ba4b005a2cb5f35020295f3 # v2.3.0
132132
with:
133133
github-token: ${{ steps.get_token.outputs.token }}
134134
repo: ${{ inputs.target-repo || 'datadog-api-spec' }}
135135
status: failure
136136
context: ${{ inputs.status-context || 'integration' }}
137137
- name: Post success status check
138138
if: "!failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/') && (inputs.enable-status-reporting || github.event_name != 'workflow_call')"
139-
uses: DataDog/github-actions/post-status-check@v2
139+
uses: DataDog/github-actions/post-status-check@65b4875f33ad773d7ba4b005a2cb5f35020295f3 # v2.3.0
140140
with:
141141
github-token: ${{ steps.get_token.outputs.token }}
142142
repo: ${{ inputs.target-repo || 'datadog-api-spec' }}

.github/workflows/reusable-java-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ jobs:
3636
runs-on: ${{ matrix.platform }}
3737
steps:
3838
- name: Checkout code
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4040
with:
4141
repository: DataDog/datadog-api-client-java
4242
ref: ${{ inputs.target-branch || github.ref }}
4343
- name: Install Java
44-
uses: actions/setup-java@v3
44+
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
4545
with:
4646
java-version: ${{ matrix.java-version }}
4747
distribution: "temurin"
4848
cache: "maven"
4949
- name: Configure Datadog Test Optimization
50-
uses: datadog/test-visibility-github-action@v2
50+
uses: datadog/test-visibility-github-action@4e7afb05b464fd349275e41e65a7f4de83e7f46b # v2.10.0
5151
with:
5252
languages: java
5353
api_key: ${{ secrets.DD_API_KEY }}

.github/workflows/reusable-javadoc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
javadoc:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222
with:
2323
repository: DataDog/datadog-api-client-java
2424
ref: ${{ inputs.target-branch || github.ref }}
2525
- name: Install Java
26-
uses: actions/setup-java@v3
26+
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
2727
with:
2828
java-version: ${{ inputs.java-version }}
2929
distribution: "temurin"

.github/workflows/reusable-pre-commit.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ jobs:
3232
with:
3333
scope: DataDog/datadog-api-client-java
3434
policy: self.github.pre-commit.pull-requests
35-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636
with:
3737
fetch-depth: 0
3838
repository: DataDog/datadog-api-client-java
3939
ref: ${{ inputs.target-branch || github.event.pull_request.head.sha || github.ref }}
4040
token: ${{ inputs.enable-commit-changes && steps.get_token.outputs.token || github.token }}
41-
- uses: actions/setup-python@v4
41+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
4242
with:
4343
python-version: '3.11'
4444
- name: Install pre-commit
4545
run: python -m pip install pre-commit
4646
- name: set PY
4747
run: echo "PY=$(python -c 'import platform;print(platform.python_version())')" >> $GITHUB_ENV
48-
- uses: actions/cache@v3
48+
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
4949
with:
5050
path: ~/.cache/pre-commit
5151
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
5252
- name: Install Java
53-
uses: actions/setup-java@v3
53+
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
5454
with:
5555
java-version: "16"
5656
distribution: "temurin"

.github/workflows/reusable-shading.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
shading:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222
with:
2323
repository: DataDog/datadog-api-client-java
2424
ref: ${{ inputs.target-branch || github.ref }}
2525
- name: Install Java
26-
uses: actions/setup-java@v3
26+
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
2727
with:
2828
java-version: ${{ inputs.java-version }}
2929
distribution: "temurin"

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
scope: DataDog/datadog-api-spec
9393
policy: datadog-api-client-java.test.post-status
9494
- name: Post status check
95-
uses: DataDog/github-actions/post-status-check@v2
95+
uses: DataDog/github-actions/post-status-check@65b4875f33ad773d7ba4b005a2cb5f35020295f3 # v2.3.0
9696
with:
9797
github-token: ${{ steps.get_token.outputs.token }}
9898
repo: datadog-api-spec

0 commit comments

Comments
 (0)