Skip to content

Commit 3500510

Browse files
committed
Fix workflow issues exposed by analyzer
1 parent 24815b7 commit 3500510

4 files changed

Lines changed: 31 additions & 17 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Build and Test
22

33
on: push
44

5-
permissions: read-all
5+
permissions:
6+
contents: read
7+
68

79
# update in build.yml and codeql.yml at same time
810
env:
@@ -19,9 +21,11 @@ jobs:
1921

2022
steps:
2123

22-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
25+
with:
26+
persist-credentials: false
2327

24-
- uses: actions/setup-node@v4
28+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
2529
with:
2630
token: ${{ secrets.GITHUB_TOKEN }}
2731
node-version: 24
@@ -42,7 +46,7 @@ jobs:
4246

4347
- run: npm run build
4448

45-
- uses: actions/upload-artifact@v4
49+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4650
with:
4751
name: js
4852
path: |
@@ -83,14 +87,16 @@ jobs:
8387

8488

8589
steps:
86-
- uses: actions/checkout@v6
90+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
91+
with:
92+
persist-credentials: false
8793

88-
- uses: actions/download-artifact@v8
94+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
8995
if: ${{ !env.ACT }}
9096
with:
9197
name: js
9298

93-
- uses: bazel-contrib/setup-bazel@0.19.0
99+
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
94100
with:
95101
token: ${{ secrets.GITHUB_TOKEN }}
96102

@@ -104,7 +110,7 @@ jobs:
104110
# need to copy to output directory as `bazel-bin` is a symlink and cannot be read by the actions/upload-artifact action
105111
- run: cp bazel-bin/protobuf-javascript-* out/
106112

107-
- uses: actions/upload-artifact@v4
113+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
108114
with:
109115
name: release-${{ matrix.os }}-${{ matrix.cpu }}
110116
path: out

.github/workflows/codeql.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ jobs:
4949

5050
steps:
5151
- name: Checkout repository
52-
uses: actions/checkout@v6
52+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
53+
with:
54+
persist-credentials: false
5355

5456
# Initializes the CodeQL tools for scanning.
5557
- name: Initialize CodeQL
56-
uses: github/codeql-action/init@v4
58+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
5759
with:
5860
languages: ${{ matrix.language }}
5961
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -81,4 +83,4 @@ jobs:
8183
- run: npm test
8284

8385
- name: Perform CodeQL Analysis
84-
uses: github/codeql-action/analyze@v4
86+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
type: string
2222
jobs:
2323
publish:
24-
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.2.3
24+
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@1a42c3dca6566cf3a07689768259f1a35066ed01 # v0.2.3
2525
with:
2626
draft: false
2727
tag_name: ${{ inputs.tag_name }}

.github/workflows/release.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,26 @@ on:
1515
tags:
1616
- "v*.*.*"
1717
permissions:
18-
id-token: write
19-
attestations: write
20-
contents: write
18+
contents: read
19+
2120
jobs:
2221
release:
23-
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7.2.3
22+
permissions:
23+
id-token: write
24+
attestations: write
25+
contents: write
26+
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@a841d62420f41a87a601fb331f3c2c2cc088506e # v7.2.3
2427
with:
2528
bazel_test_command: "bazel build //:bcr_dist_tar"
2629
prerelease: false
2730
release_files: "bazel-bin/protobuf-javascript-*.tar.gz"
2831
tag_name: ${{ inputs.tag_name || github.ref_name }}
29-
secrets: inherit
3032
publish:
3133
needs: release
34+
permissions:
35+
id-token: write
36+
attestations: write
37+
contents: write
3238
uses: ./.github/workflows/publish.yaml
3339
with:
3440
tag_name: ${{ inputs.tag_name || github.ref_name }}

0 commit comments

Comments
 (0)