Skip to content

Commit 009d9b6

Browse files
committed
FIx Zizmor issues
1 parent 3299bbf commit 009d9b6

File tree

6 files changed

+41
-93
lines changed

6 files changed

+41
-93
lines changed

.github/actions/context/action.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,21 @@ runs:
6565
env:
6666
# The default branch of the repository, in this case "master"
6767
default_branch: ${{ github.event.repository.default_branch }}
68+
event_name: ${{ github.event_name }}
69+
event_action: ${{ github.event.action }}
70+
ref_name: ${{ github.ref_name }}
71+
head_ref: ${{ github.head_ref }}
72+
release_tag_name: ${{ github.event.release.tag_name }}
6873
shell: bash
6974
run: |
70-
event_name="${{ github.event_name }}"
71-
event_action="${{ github.event.action }}"
72-
7375
# Stable check for if the workflow is running on the default branch
7476
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
7577
is_default_branch="${{ format('refs/heads/{0}', env.default_branch) == github.ref }}"
7678
7779
# In most events, the epository refers to the head which would be the fork
7880
is_fork="${{ github.event.repository.fork }}"
7981
# Default version is the branch name
80-
docker_version="${{ github.ref_name }}"
82+
docker_version="${ref_name}"
8183
8284
# This is different in a pull_request where we need to check the head explicitly
8385
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
@@ -87,7 +89,7 @@ runs:
8789
is_dependabot="${{ github.actor == 'dependabot[bot]' }}"
8890
8991
# For PRs we need to reference the head branch
90-
docker_version="${{ github.head_ref }}"
92+
docker_version="${head_ref}"
9193
9294
# If the head repository is a fork or if the PR is opened by dependabot
9395
# we consider the run to be a fork. Dependabot and proper forks are treated
@@ -115,7 +117,7 @@ runs:
115117
is_release_tag="true"
116118
117119
# If we are releasing a tag, we tag the docker version as the git tag
118-
docker_version="${{ github.event.release.tag_name }}"
120+
docker_version="${release_tag_name}"
119121
fi
120122
fi
121123
@@ -128,4 +130,4 @@ runs:
128130
echo "git_sha=${{ github.sha }}" >> $GITHUB_OUTPUT
129131
130132
echo "event_name: $event_name"
131-
cat $GITHUB_OUTPUT
133+
cat "${GITHUB_OUTPUT}"

.github/actions/pr-comment/action.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ runs:
3333
shell: bash
3434
env:
3535
GH_TOKEN: ${{ inputs.github_token }}
36+
repo: ${{ inputs.repo }}
37+
pr_number: ${{ inputs.pr }}
38+
edit_last: ${{ inputs.edit_last }}
39+
body: ${{ inputs.body }}
3640
run: |
3741
# --- Input variables ---
38-
repo="${{ inputs.repo }}"
39-
pr_number="${{ inputs.pr }}"
40-
edit_last="${{ inputs.edit_last }}"
4142
tmp_file=$(mktemp)
4243
4344
cat <<'EOF' > "$tmp_file"
44-
${{ inputs.body }}
45+
${body}
4546
EOF
4647
4748
args="--repo ${repo} --body-file $tmp_file --create-if-none"

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
env:
1212
SLACK_CHANNEL: ${{ vars.SLACK_CHANNEL_TEST }}
1313

14+
permissions: {}
15+
1416
jobs:
1517
test_actions:
1618
permissions:
@@ -31,6 +33,8 @@ jobs:
3133
run: make ${{ matrix.target }}
3234

3335
slack_action_payload:
36+
permissions:
37+
contents: 'read'
3438
runs-on: ubuntu-latest
3539
name: Test Slack Action ${{ matrix.name }}
3640
strategy:
@@ -110,6 +114,8 @@ jobs:
110114

111115
steps:
112116
- uses: actions/checkout@v4
117+
with:
118+
persist-credentials: false
113119

114120
- name: Slack Action Payload
115121
id: slack
@@ -164,6 +170,8 @@ jobs:
164170

165171
steps:
166172
- uses: actions/checkout@v4
173+
with:
174+
persist-credentials: false
167175

168176
- name: "Test Slack Action: ${{ matrix.name }}"
169177
id: slack
@@ -173,7 +181,7 @@ jobs:
173181
# We explicitly don't pass the slack token so that we can test
174182
# If the action actually attempts to send a message. This would
175183
# fail and we can assert that an attempt was made to send the message.
176-
# slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
184+
slack_token: ''
177185
payload: |
178186
channel: ${{ vars.SLACK_CHANNEL_TEST }}
179187
text: "Dry run is '${{ matrix.dry_run }}'"
@@ -270,6 +278,8 @@ jobs:
270278

271279
steps:
272280
- uses: actions/checkout@v4
281+
with:
282+
persist-credentials: false
273283

274284
- name: Slack Workflow Notification
275285
uses: ./.github/actions/slack-workflow-notification

.github/workflows/docs.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ on:
1111
env:
1212
docs_artifact: docs
1313

14+
permissions: {}
15+
1416
jobs:
1517
context:
1618
runs-on: ubuntu-latest
19+
permissions:
20+
contents: 'read'
1721

1822
outputs:
1923
is_release_master: ${{ steps.context.outputs.is_release_master }}
@@ -22,14 +26,23 @@ jobs:
2226
steps:
2327
- name: Checkout code
2428
uses: actions/checkout@v4
29+
with:
30+
persist-credentials: false
31+
2532
- id: context
2633
uses: ./.github/actions/context
2734

2835
docs_build:
36+
permissions:
37+
contents: 'read'
38+
actions: 'write'
39+
2940
runs-on: ubuntu-latest
3041
steps:
3142
- name: Checkout code
3243
uses: actions/checkout@v4
44+
with:
45+
persist-credentials: false
3346

3447
- name: Set up Python
3548
uses: actions/setup-python@v5

.github/workflows/stale.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
schedule:
1010
- cron: '41 0 * * *'
1111

12+
permissions: {}
13+
1214
jobs:
1315
stale:
1416

@@ -22,7 +24,7 @@ jobs:
2224
repo-token: ${{ secrets.GITHUB_TOKEN }}
2325
stale-issue-message: >
2426
This issue has been automatically marked as stale because it has not had
25-
recent activity. If you think this bug should stay open, please comment on
27+
recent activity. If you think this bug should stay open, please comment on
2628
the issue with further details. Thank you for your contributions.
2729
stale-issue-label: 'state:stale'
2830
days-before-stale: 180

.github/workflows/transfer-issues.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)