Skip to content

Commit a467830

Browse files
authored
fix: fixed the token-permission and pinned-dependencies issue (#6168)
Signed-off-by: harshitasao <[email protected]>
1 parent f077e8e commit a467830

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

.github/workflows/build-image.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,29 @@ on:
1212
- 'build-image/**'
1313
- '.github/workflows/build-image.yml'
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
build:
1720
runs-on: ubuntu-24.04
1821
steps:
19-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2023
name: Checkout
2124
with:
2225
fetch-depth: 0
2326

2427
- name: Set up QEMU
25-
uses: docker/setup-qemu-action@v3
28+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
2629

2730
- name: Set up Docker Buildx
28-
uses: docker/setup-buildx-action@v3
31+
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
2932

3033
- name: Save image
3134
run: make save-multiarch-build-image
3235

3336
- name: Upload Docker Images Artifacts
34-
uses: actions/upload-artifact@v4
37+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
3538
with:
3639
name: build-image
3740
path: |
@@ -44,21 +47,21 @@ jobs:
4447
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
4548
runs-on: ubuntu-24.04
4649
steps:
47-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4851
name: Checkout
4952
with:
5053
fetch-depth: 0
5154

5255
- name: Download Docker Images Artifacts
53-
uses: actions/download-artifact@v4
56+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
5457
with:
5558
name: build-image
5659

5760
- name: Load image
5861
run: make load-multiarch-build-image
5962

6063
- name: Login to Quay.io
61-
uses: docker/login-action@v3
64+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
6265
with:
6366
registry: quay.io
6467
username: ${{secrets.QUAY_REGISTRY_USER}}

.github/workflows/test-build-deploy.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
image: quay.io/cortexproject/build-image:master-779dcf4ba
2121
steps:
2222
- name: Checkout Repo
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
2424
- name: Setup Git safe.directory
2525
run: |
2626
echo "this step is needed because when running in container, actions/checkout does not set safe.directory effectively."
@@ -49,7 +49,7 @@ jobs:
4949
image: quay.io/cortexproject/build-image:master-779dcf4ba
5050
steps:
5151
- name: Checkout Repo
52-
uses: actions/checkout@v2
52+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
5353
- name: Setup Git safe.directory
5454
run: |
5555
echo "this step is needed because when running in container, actions/checkout does not set safe.directory effectively."
@@ -71,19 +71,19 @@ jobs:
7171
security-events: write
7272
steps:
7373
- name: Checkout repository
74-
uses: actions/checkout@v4
74+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
7575

7676
# Initializes the CodeQL tools for scanning.
7777
- name: Initialize CodeQL
78-
uses: github/codeql-action/init@v3
78+
uses: github/codeql-action/init@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
7979
with:
8080
languages: go
8181

8282
- name: Autobuild
83-
uses: github/codeql-action/autobuild@v3
83+
uses: github/codeql-action/autobuild@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
8484

8585
- name: Perform CodeQL Analysis
86-
uses: github/codeql-action/analyze@v3
86+
uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
8787

8888

8989
build:
@@ -92,7 +92,7 @@ jobs:
9292
image: quay.io/cortexproject/build-image:master-779dcf4ba
9393
steps:
9494
- name: Checkout Repo
95-
uses: actions/checkout@v2
95+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
9696
- name: Setup Git safe.directory
9797
run: |
9898
echo "this step is needed because when running in container, actions/checkout does not set safe.directory effectively."
@@ -113,7 +113,7 @@ jobs:
113113
touch build-image/.uptodate
114114
make BUILD_IN_CONTAINER=false web-build
115115
- name: Upload Website Artifact
116-
uses: actions/upload-artifact@v4
116+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
117117
with:
118118
name: website public
119119
path: website/public/
@@ -125,7 +125,7 @@ jobs:
125125
- name: Create Docker Images Archive
126126
run: tar -cvf images.tar /tmp/images
127127
- name: Upload Docker Images Artifact
128-
uses: actions/upload-artifact@v4
128+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
129129
with:
130130
name: Docker Images
131131
path: ./images.tar
@@ -146,19 +146,19 @@ jobs:
146146
- integration_query_fuzz
147147
steps:
148148
- name: Upgrade golang
149-
uses: actions/setup-go@v2
149+
uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2.2.0
150150
with:
151151
go-version: 1.22.5
152152
- name: Checkout Repo
153-
uses: actions/checkout@v2
153+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
154154
- name: Install Docker Client
155155
run: sudo ./.github/workflows/scripts/install-docker.sh
156156
- name: Sym Link Expected Path to Workspace
157157
run: |
158158
sudo mkdir -p /go/src/github.com/cortexproject/cortex
159159
sudo ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
160160
- name: Download Docker Images Artifacts
161-
uses: actions/download-artifact@v4
161+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
162162
with:
163163
name: Docker Images
164164
- name: Extract Docker Images Archive
@@ -209,11 +209,11 @@ jobs:
209209
runs-on: ubuntu-20.04
210210
steps:
211211
- name: Checkout Repo
212-
uses: actions/checkout@v2
212+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
213213
- name: Install Docker Client
214214
run: sudo ./.github/workflows/scripts/install-docker.sh
215215
- name: Download Docker Images Artifact
216-
uses: actions/download-artifact@v4
216+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
217217
with:
218218
name: Docker Images
219219
- name: Extract Docker Images Archive
@@ -233,7 +233,7 @@ jobs:
233233
image: quay.io/cortexproject/build-image:master-779dcf4ba
234234
steps:
235235
- name: Checkout Repo
236-
uses: actions/checkout@v2
236+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
237237
with:
238238
# web-deploy script expects repo to be cloned with ssh for some commands to work
239239
ssh-key: ${{ secrets.WEBSITE_DEPLOY_SSH_PRIVATE_KEY }}
@@ -247,7 +247,7 @@ jobs:
247247
mkdir -p /go/src/github.com/cortexproject/cortex
248248
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
249249
- name: Download Website Artifact
250-
uses: actions/download-artifact@v4
250+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
251251
with:
252252
name: website public
253253
path: website/public
@@ -275,7 +275,7 @@ jobs:
275275
image: quay.io/cortexproject/build-image:master-779dcf4ba
276276
steps:
277277
- name: Checkout Repo
278-
uses: actions/checkout@v2
278+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
279279
- name: Setup Git safe.directory
280280
run: |
281281
echo "this step is needed because when running in container, actions/checkout does not set safe.directory effectively."
@@ -288,7 +288,7 @@ jobs:
288288
mkdir -p /go/src/github.com/cortexproject/cortex
289289
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
290290
- name: Download Docker Images Artifact
291-
uses: actions/download-artifact@v4
291+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
292292
with:
293293
name: Docker Images
294294
- name: Extract Docker Images Archive

0 commit comments

Comments
 (0)