Skip to content

Commit b1370db

Browse files
DEVOPS-7261 - security: pin GitHub Actions to commit SHAs (#2051)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Aaron Bacchi <abacchilb@users.noreply.github.com>
1 parent 9549be4 commit b1370db

7 files changed

Lines changed: 58 additions & 58 deletions

File tree

.github/workflows/lbox-develop.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
test-matrix: ${{ steps.matrix.outputs.test-matrix }}
2222
package-matrix: ${{ steps.matrix.outputs.publish-matrix }}
2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2525
with:
2626
ref: ${{ github.head_ref }}
27-
- uses: dorny/paths-filter@v3
27+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
2828
id: filter
2929
with:
3030
list-files: 'json'
@@ -47,7 +47,7 @@ jobs:
4747
group: lbox-staging-${{ matrix.python-version }}-${{ matrix.package }}
4848
cancel-in-progress: false
4949
steps:
50-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
5151
with:
5252
ref: ${{ github.head_ref }}
5353
- uses: ./.github/actions/python-package-shared-setup
@@ -83,7 +83,7 @@ jobs:
8383
# IMPORTANT: this permission is mandatory for trusted publishing
8484
id-token: write
8585
steps:
86-
- uses: actions/checkout@v4
86+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
8787
with:
8888
ref: ${{ github.head_ref }}
8989
- uses: ./.github/actions/python-package-shared-setup
@@ -100,7 +100,7 @@ jobs:
100100
rye run toml set --toml-path pyproject.toml project.name ${{ matrix.package }}
101101
rye build
102102
- name: Publish package distributions to Test PyPI
103-
uses: pypa/gh-action-pypi-publish@release/v1
103+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
104104
with:
105105
packages-dir: dist/
106106
repository-url: https://test.pypi.org/legacy/
@@ -117,20 +117,20 @@ jobs:
117117
# IMPORTANT: this permission is mandatory for trusted publishing
118118
packages: write
119119
steps:
120-
- uses: actions/checkout@v4
120+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
121121
with:
122122
ref: ${{ github.head_ref }}
123123
- name: Set up Docker Buildx
124-
uses: docker/setup-buildx-action@v3
124+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
125125
- name: Log in to the Container registry
126-
uses: docker/login-action@v3
126+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
127127
with:
128128
registry: ghcr.io
129129
username: ${{ github.actor }}
130130
password: ${{ secrets.GITHUB_TOKEN }}
131131
- name: Build and push (Develop)
132132
if: github.event_name == 'push'
133-
uses: docker/build-push-action@v5
133+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
134134
with:
135135
context: .
136136
file: ./libs/${{ matrix.package }}/Dockerfile
@@ -149,7 +149,7 @@ jobs:
149149
echo "ghcr.io/labelbox/${{ matrix.package }}:${{ github.sha }}" >> "$GITHUB_STEP_SUMMARY"
150150
- name: Build and push (Pull Request)
151151
if: github.event_name == 'pull_request'
152-
uses: docker/build-push-action@v5
152+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
153153
with:
154154
context: .
155155
file: ./libs/${{ matrix.package }}/Dockerfile

.github/workflows/lbox-publish.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
test-matrix: ${{ steps.matrix.outputs.test-matrix }}
2828
package-matrix: ${{ steps.matrix.outputs.publish-matrix }}
2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3131
with:
3232
ref: ${{ inputs.tag }}
33-
- uses: dorny/paths-filter@v3
33+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
3434
id: filter
3535
with:
3636
base: ${{ inputs.prev_sdk_tag }}
@@ -52,11 +52,11 @@ jobs:
5252
matrix:
5353
include: ${{ fromJSON(needs.path-filter.outputs.package-matrix) }}
5454
steps:
55-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
5656
with:
5757
ref: ${{ inputs.tag }}
5858
- name: Install the latest version of rye
59-
uses: eifinger/setup-rye@v2
59+
uses: eifinger/setup-rye@787604a465b1696ad17eedf2f8101df9fc555c94 # v2
6060
with:
6161
version: ${{ vars.RYE_VERSION }}
6262
enable-cache: true
@@ -73,7 +73,7 @@ jobs:
7373
run: |
7474
cd dist && echo "hashes_${{ matrix.package }}=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
7575
echo "hashes_${{ matrix.package }}=$(sha256sum * | base64 -w0)"
76-
- uses: actions/upload-artifact@v4
76+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
7777
with:
7878
name: build-${{ matrix.package }}
7979
path: ./dist
@@ -83,7 +83,7 @@ jobs:
8383
actions: read
8484
contents: write
8585
id-token: write # Needed to access the workflow's OIDC identity.
86-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
86+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@5a775b367a56d5bd118a224a811bba288150a563 # v2.0.0
8787
with:
8888
base64-subjects: "${{ needs.build.outputs.hashes }}"
8989
upload-assets: true
@@ -102,7 +102,7 @@ jobs:
102102
group: lbox-staging-${{ matrix.python-version }}-${{ matrix.package }}
103103
cancel-in-progress: false
104104
steps:
105-
- uses: actions/checkout@v4
105+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
106106
with:
107107
ref: ${{ inputs.tag }}
108108
- uses: ./.github/actions/python-package-shared-setup
@@ -137,12 +137,12 @@ jobs:
137137
# IMPORTANT: this permission is mandatory for trusted publishing
138138
id-token: write
139139
steps:
140-
- uses: actions/download-artifact@v4
140+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
141141
with:
142142
name: build-${{ matrix.package }}
143143
path: ./artifact
144144
- name: Publish package distributions to PyPI
145-
uses: pypa/gh-action-pypi-publish@release/v1
145+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
146146
with:
147147
packages-dir: artifact/
148148
verbose: true
@@ -158,20 +158,20 @@ jobs:
158158
# IMPORTANT: this permission is mandatory for trusted publishing
159159
packages: write
160160
steps:
161-
- uses: actions/checkout@v4
161+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
162162
with:
163163
# ref: ${{ inputs.tag }}
164164
ref: ${{ inputs.tag }}
165165
- name: Set up Docker Buildx
166-
uses: docker/setup-buildx-action@v3
166+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
167167
- name: Log in to the Container registry
168-
uses: docker/login-action@v3
168+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
169169
with:
170170
registry: ghcr.io
171171
username: ${{ github.actor }}
172172
password: ${{ secrets.GITHUB_TOKEN }}
173173
- name: Build and push
174-
uses: docker/build-push-action@v5
174+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
175175
id: build_container
176176
with:
177177
context: .

.github/workflows/notebooks.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
if: github.event.pull_request.merged == false
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2424
with:
2525
ref: ${{ github.head_ref }}
2626
fetch-depth: 0
@@ -38,7 +38,7 @@ jobs:
3838
git add examples/.
3939
git commit -m ":art: Cleaned" || exit 0
4040
- name: Push changes
41-
uses: ad-m/github-push-action@master
41+
uses: ad-m/github-push-action@4cc74773234f74829a8c21bc4d69dd4be9cfa599 # master
4242
with:
4343
github_token: ${{ secrets.GITHUB_TOKEN }}
4444
branch: ${{ github.head_ref }}
@@ -50,7 +50,7 @@ jobs:
5050
outputs:
5151
addedOrModified: ${{ steps.filter.outputs.addedOrModified }}
5252
steps:
53-
- uses: dorny/paths-filter@v3
53+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
5454
id: filter
5555
with:
5656
filters: |
@@ -62,7 +62,7 @@ jobs:
6262
if: ${{ needs.changes.outputs.addedOrModified == 'true' }} && github.event.pull_request.merged == false
6363
runs-on: ubuntu-latest
6464
steps:
65-
- uses: actions/checkout@v4
65+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
6666
with:
6767
ref: ${{ github.head_ref }}
6868
fetch-depth: 0
@@ -80,7 +80,7 @@ jobs:
8080
git add examples/.
8181
git commit -m ":memo: README updated" || exit 0
8282
- name: Push changes
83-
uses: ad-m/github-push-action@master
83+
uses: ad-m/github-push-action@4cc74773234f74829a8c21bc4d69dd4be9cfa599 # master
8484
with:
8585
github_token: ${{ secrets.GITHUB_TOKEN }}
8686
branch: ${{ github.head_ref }}

.github/workflows/publish.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343
outputs:
4444
hashes: ${{ steps.hash.outputs.hashes }}
4545
steps:
46-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
4747
with:
4848
ref: ${{ inputs.tag }}
4949
- name: Install the latest version of rye
50-
uses: eifinger/setup-rye@v2
50+
uses: eifinger/setup-rye@787604a465b1696ad17eedf2f8101df9fc555c94 # v2
5151
with:
5252
version: ${{ vars.RYE_VERSION }}
5353
enable-cache: true
@@ -63,7 +63,7 @@ jobs:
6363
id: hash
6464
run: |
6565
cd dist && echo "hashes=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
66-
- uses: actions/upload-artifact@v4
66+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
6767
with:
6868
name: build
6969
path: ./dist
@@ -73,7 +73,7 @@ jobs:
7373
actions: read
7474
contents: write
7575
id-token: write # Needed to access the workflow's OIDC identity.
76-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
76+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@5a775b367a56d5bd118a224a811bba288150a563 # v2.0.0
7777
with:
7878
base64-subjects: "${{ needs.build.outputs.hashes }}"
7979
upload-assets: true
@@ -102,11 +102,11 @@ jobs:
102102
prod-key: PROD_LABELBOX_API_KEY_2
103103
da-test-key: DA_GCP_LABELBOX_API_KEY
104104
steps:
105-
- uses: actions/checkout@v4
105+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
106106
with:
107107
ref: ${{ inputs.tag }}
108108
- name: Install the latest version of rye
109-
uses: eifinger/setup-rye@v2
109+
uses: eifinger/setup-rye@787604a465b1696ad17eedf2f8101df9fc555c94 # v2
110110
with:
111111
version: ${{ vars.RYE_VERSION }}
112112
enable-cache: true
@@ -115,7 +115,7 @@ jobs:
115115
rye config --set-bool behavior.use-uv=true
116116
- name: Python setup
117117
run: rye pin ${{ matrix.python-version }}
118-
- uses: actions/download-artifact@v4
118+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
119119
with:
120120
name: build
121121
path: ./dist
@@ -151,10 +151,10 @@ jobs:
151151
permissions:
152152
contents: write
153153
steps:
154-
- uses: actions/checkout@v4
154+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
155155
with:
156156
ref: ${{ inputs.tag }}
157-
- uses: actions/download-artifact@v4
157+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
158158
with:
159159
name: build
160160
path: ./artifact
@@ -176,12 +176,12 @@ jobs:
176176
# IMPORTANT: this permission is mandatory for trusted publishing
177177
id-token: write
178178
steps:
179-
- uses: actions/download-artifact@v4
179+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
180180
with:
181181
name: build
182182
path: ./artifact
183183
- name: Publish package distributions to PyPI
184-
uses: pypa/gh-action-pypi-publish@release/v1
184+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
185185
with:
186186
packages-dir: artifact/
187187
container-publish:
@@ -198,7 +198,7 @@ jobs:
198198
env:
199199
CONTAINER_IMAGE: "ghcr.io/${{ github.repository }}"
200200
steps:
201-
- uses: actions/checkout@v4
201+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
202202
with:
203203
ref: ${{ inputs.tag }}
204204

@@ -207,17 +207,17 @@ jobs:
207207
echo "CONTAINER_IMAGE=${CONTAINER_IMAGE,,}" >> ${GITHUB_ENV}
208208
209209
- name: Set up Docker Buildx
210-
uses: docker/setup-buildx-action@v3
210+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
211211

212212
- name: Log in to the Container registry
213-
uses: docker/login-action@v3
213+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
214214
with:
215215
registry: ghcr.io
216216
username: ${{ github.actor }}
217217
password: ${{ secrets.GITHUB_TOKEN }}
218218

219219
- name: Build and push
220-
uses: docker/build-push-action@v5
220+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
221221
id: build_container
222222
with:
223223
context: .
@@ -246,7 +246,7 @@ jobs:
246246
actions: read # for detecting the Github Actions environment.
247247
id-token: write # for creating OIDC tokens for signing.
248248
packages: write # for uploading attestations.
249-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
249+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@5a775b367a56d5bd118a224a811bba288150a563 # v2.0.0
250250
with:
251251
image: ${{ needs. container-publish.outputs.image }}
252252
digest: ${{ needs. container-publish.outputs.digest }}

0 commit comments

Comments
 (0)