Skip to content

Commit a4fa667

Browse files
ci: fix zizmor audit findings
1 parent 9fc1ab8 commit a4fa667

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- .github/workflows/build.yml
88

99
permissions:
10-
contents: write
10+
contents: read
1111

1212
concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
@@ -24,6 +24,8 @@ jobs:
2424
steps:
2525
- name: Checkout Repository
2626
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
27+
with:
28+
persist-credentials: false
2729
- name: Install Packages
2830
run: |
2931
sudo apt update
@@ -56,6 +58,8 @@ jobs:
5658
steps:
5759
- name: Checkout Repository
5860
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
61+
with:
62+
persist-credentials: false
5963
- name: Install dependencies
6064
run: python3 -m pip install --upgrade requests
6165
- name: Download Bullseye Sysroot Artifacts

.github/workflows/upstream-sysroot.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,43 @@ jobs:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
steps:
2929
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
with:
31+
persist-credentials: false
3032
- name: Fetch Current SHA
3133
shell: bash
3234
run: |
33-
if [ -n "${{ github.event.inputs.current-sha }}" ]; then
34-
CURRENT_SHA="${{ github.event.inputs.current-sha }}"
35+
if [ -n "${GITHUB_EVENT_INPUTS_CURRENT_SHA}" ]; then
36+
CURRENT_SHA="${GITHUB_EVENT_INPUTS_CURRENT_SHA}"
3537
elif [ -f current-sha.json ]; then
3638
CURRENT_SHA=$(jq -r '.sha' current-sha.json)
3739
else
3840
echo "No current SHA provided and current-sha.json not found."
3941
exit 1
4042
fi
4143
echo "CURRENT_SHA=${CURRENT_SHA}" >> $GITHUB_ENV
44+
env:
45+
GITHUB_EVENT_INPUTS_CURRENT_SHA: ${{ github.event.inputs.current-sha }}
4246
- name: Fetch latest upstream SHA
4347
shell: bash
4448
run: |
45-
if [ -n "${{ github.event.inputs.upstream-sha }}" ]; then
46-
UPSTREAM_SHA="${{ github.event.inputs.upstream-sha }}"
49+
if [ -n "${GITHUB_EVENT_INPUTS_UPSTREAM_SHA}" ]; then
50+
UPSTREAM_SHA="${GITHUB_EVENT_INPUTS_UPSTREAM_SHA}"
4751
else
4852
UPSTREAM_SHA=$(gh api -X GET repos/chromium/chromium/commits -f path="build/linux/sysroot_scripts" -f per_page=1 --jq '.[0].sha')
4953
fi
5054
echo "UPSTREAM_SHA=${UPSTREAM_SHA}" >> $GITHUB_ENV
55+
env:
56+
GITHUB_EVENT_INPUTS_UPSTREAM_SHA: ${{ github.event.inputs.upstream-sha }}
5157
- name: Compare current SHA with upstream SHA
5258
shell: bash
5359
run: |
54-
if [ "${{ env.CURRENT_SHA }}" == "${{ env.UPSTREAM_SHA }}" ]; then
60+
if [ "${CURRENT_SHA}" == "${UPSTREAM_SHA}" ]; then
5561
echo "No changes found - sysroot scripts are up to date!"
5662
else
5763
gh api -X GET repos/chromium/chromium/commits -f path="build/linux/sysroot_scripts" -f per_page=20 > commits.json
5864
5965
COMMITS=$(
60-
jq -r --arg base_sha "${{ env.CURRENT_SHA }}" '
66+
jq -r --arg base_sha "${CURRENT_SHA}" '
6167
([.[].sha] | index($base_sha) // length) as $idx |
6268
.[0:$idx] | .[] |
6369
"- [`\(.sha[0:7])`](\(.html_url)) \(.commit.message | split("\n")[0])"

0 commit comments

Comments
 (0)