diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 1599e3925f..964b1fc755 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -48,11 +48,13 @@ jobs: - name: Check tag consistency if: ${{ inputs.plan != '' && !fromJson(inputs.plan).announcement_tag_is_implicit }} + env: + TAG: ${{ inputs.plan != '' && fromJson(inputs.plan).announcement_tag || 'dry-run' }} run: | version=$(grep "version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g') - if [ "${{ fromJson(inputs.plan).announcement_tag }}" != "${version}" ]; then + if [ "${TAG}" != "${version}" ]; then echo "The input tag does not match the version from pyproject.toml:" >&2 - echo "${{ fromJson(inputs.plan).announcement_tag }}" >&2 + echo "${TAG}" >&2 echo "${version}" >&2 exit 1 else @@ -175,6 +177,8 @@ jobs: - name: Generate Dynamic Dockerfile Tags shell: bash + env: + TAG_VALUE: ${{ fromJson(inputs.plan).announcement_tag }} run: | set -euo pipefail @@ -195,8 +199,8 @@ jobs: # Loop through all base tags and append its docker metadata pattern to the list # Order is on purpose such that the label org.opencontainers.image.version has the first pattern with the full version IFS=','; for TAG in ${BASE_TAGS}; do - TAG_PATTERNS="${TAG_PATTERNS}type=pep440,pattern={{ version }},suffix=-${TAG},value=${{ fromJson(inputs.plan).announcement_tag }}\n" - TAG_PATTERNS="${TAG_PATTERNS}type=pep440,pattern={{ major }}.{{ minor }},suffix=-${TAG},value=${{ fromJson(inputs.plan).announcement_tag }}\n" + TAG_PATTERNS="${TAG_PATTERNS}type=pep440,pattern={{ version }},suffix=-${TAG},value=${TAG_VALUE}\n" + TAG_PATTERNS="${TAG_PATTERNS}type=pep440,pattern={{ major }}.{{ minor }},suffix=-${TAG},value=${TAG_VALUE}}\n" TAG_PATTERNS="${TAG_PATTERNS}type=raw,value=${TAG}\n" done diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 108d4e28fd..72ee0da06c 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -33,8 +33,9 @@ jobs: python-version: 3.12 - name: "Set docs version" + env: + version: ${{ (inputs.plan != '' && fromJson(inputs.plan).announcement_tag) || inputs.ref }} run: | - version="${{ (inputs.plan != '' && fromJson(inputs.plan).announcement_tag) || inputs.ref }}" # if version is missing, use 'latest' if [ -z "$version" ]; then echo "Using 'latest' as version" diff --git a/.github/zizmor.yml b/.github/zizmor.yml index 2861f925ec..5e738105ef 100644 --- a/.github/zizmor.yml +++ b/.github/zizmor.yml @@ -1,6 +1,12 @@ # Configuration for the zizmor static analysis tool, run via pre-commit in CI # https://woodruffw.github.io/zizmor/configuration/ +# +# TODO: can we remove the ignores here so that our workflows are more secure? rules: dangerous-triggers: ignore: - pr-comment.yaml + cache-poisoning: + ignore: + - build-docker.yml + - publish-playground.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6d33f2d011..09637eb33c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -91,7 +91,7 @@ repos: # zizmor detects security vulnerabilities in GitHub Actions workflows. # Additional configuration for the tool is found in `.github/zizmor.yml` - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v0.10.0 + rev: v1.0.0 hooks: - id: zizmor