Skip to content

Commit 63136c7

Browse files
committed
Upgrade zizmor to the latest version in CI
1 parent f29c9e4 commit 63136c7

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

.github/workflows/build-docker.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ jobs:
4848

4949
- name: Check tag consistency
5050
if: ${{ inputs.plan != '' && !fromJson(inputs.plan).announcement_tag_is_implicit }}
51+
env:
52+
TAG: ${{ fromJson(inputs.plan).announcement_tag || 'dry-run' }}
5153
run: |
5254
version=$(grep "version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g')
53-
if [ "${{ fromJson(inputs.plan).announcement_tag }}" != "${version}" ]; then
55+
if [ "${TAG}" != "${version}" ]; then
5456
echo "The input tag does not match the version from pyproject.toml:" >&2
55-
echo "${{ fromJson(inputs.plan).announcement_tag }}" >&2
57+
echo "${TAG}" >&2
5658
echo "${version}" >&2
5759
exit 1
5860
else
@@ -175,6 +177,8 @@ jobs:
175177

176178
- name: Generate Dynamic Dockerfile Tags
177179
shell: bash
180+
env:
181+
TAG_VALUE: ${{ fromJson(inputs.plan).announcement_tag }}
178182
run: |
179183
set -euo pipefail
180184
@@ -195,8 +199,8 @@ jobs:
195199
# Loop through all base tags and append its docker metadata pattern to the list
196200
# Order is on purpose such that the label org.opencontainers.image.version has the first pattern with the full version
197201
IFS=','; for TAG in ${BASE_TAGS}; do
198-
TAG_PATTERNS="${TAG_PATTERNS}type=pep440,pattern={{ version }},suffix=-${TAG},value=${{ fromJson(inputs.plan).announcement_tag }}\n"
199-
TAG_PATTERNS="${TAG_PATTERNS}type=pep440,pattern={{ major }}.{{ minor }},suffix=-${TAG},value=${{ fromJson(inputs.plan).announcement_tag }}\n"
202+
TAG_PATTERNS="${TAG_PATTERNS}type=pep440,pattern={{ version }},suffix=-${TAG},value=${TAG_VALUE}\n"
203+
TAG_PATTERNS="${TAG_PATTERNS}type=pep440,pattern={{ major }}.{{ minor }},suffix=-${TAG},value=${TAG_VALUE}}\n"
200204
TAG_PATTERNS="${TAG_PATTERNS}type=raw,value=${TAG}\n"
201205
done
202206

.github/workflows/publish-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ jobs:
3333
python-version: 3.12
3434

3535
- name: "Set docs version"
36+
env:
37+
version: ${{ (inputs.plan != '' && fromJson(inputs.plan).announcement_tag) || inputs.ref }}
3638
run: |
37-
version="${{ (inputs.plan != '' && fromJson(inputs.plan).announcement_tag) || inputs.ref }}"
3839
# if version is missing, use 'latest'
3940
if [ -z "$version" ]; then
4041
echo "Using 'latest' as version"

.github/zizmor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Configuration for the zizmor static analysis tool, run via pre-commit in CI
22
# https://woodruffw.github.io/zizmor/configuration/
3+
#
4+
# TODO: can we remove the ignores here so that our workflows are more secure?
35
rules:
46
dangerous-triggers:
57
ignore:
68
- pr-comment.yaml
9+
cache-poisoning:
10+
ignore:
11+
- build-docker.yml
12+
- publish-playground.yml

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ repos:
9191
# zizmor detects security vulnerabilities in GitHub Actions workflows.
9292
# Additional configuration for the tool is found in `.github/zizmor.yml`
9393
- repo: https://github.com/woodruffw/zizmor-pre-commit
94-
rev: v0.10.0
94+
rev: v1.0.0
9595
hooks:
9696
- id: zizmor
9797

0 commit comments

Comments
 (0)