Skip to content

Lock GitHub Actions workflows with an actions lockfile (#2096) - #2102

Open
rahul05ranjan wants to merge 2 commits into
PyCalendar:mainfrom
rahul05ranjan:lock-github-actions
Open

rahul05ranjan wants to merge 2 commits into
PyCalendar:mainfrom
rahul05ranjan:lock-github-actions

Conversation

@rahul05ranjan

Copy link
Copy Markdown

Fixes #2096.

Per hugovk.dev's write-up of the new GitHub Actions workflow lockfiles:

  • Every workflow pins its actions by version tag instead of the full SHA — uses: actions/checkout@v7.0.1 — with the tag-to-commit mapping machine-generated into .github/workflows/actions.lock by gh actions-lock (github/gh-actions-lock v0.4.1). The lockfile carries the commit, owner and repo ids for each dependency, exactly as the tool emits it; it is not hand-edited.
  • A new lockfile job in the zizmor workflow runs gh actions-lock --verify, failing when the lockfile is out of sync with the workflows or a locked pin no longer verifies upstream — the validation GitHub recommends for CI. Its gh extension install github/gh-actions-lock --pin v0.4.1 pins the extension itself.
  • Dependabot already supports the lockfile for its github-actions group, so the periodic bumps keep actions.lock updated alongside the workflows.
  • zizmor is bumped to 1.32.0 in both pyproject.toml and the workflow (v1.32.0 is the first release to read the lockfile): it accepts the tag pins only because actions.lock backs them.

SHA→tag conversions are limited to what gh actions-lock produced — no other workflow edits. A news fragment (news/2096.internal) is included.

I used AI to assist me with this change.

Every workflow now pins its actions by version tag, with the
tag-to-commit mapping machine-generated into .github/workflows/
actions.lock by gh actions-lock (github/gh-actions-lock v0.4.1),
following https://hugovk.dev/blog/2026/lock-github-actions/.

A new lockfile job in the zizmor workflow runs gh actions-lock
--verify, failing when the lockfile is out of sync with the workflows
or a locked pin no longer verifies upstream. Dependabot keeps the
lockfile updated with its github-actions group.

zizmor is bumped to 1.32.0, the first release that reads the lockfile:
it accepts the tag pins only because actions.lock backs them.

Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @rahul05ranjan! A maintainer will review it shortly.

@github-actions github-actions Bot added the ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding. label Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

One or more PR-quality checks did not pass. Review the PR Quality Checks summary in the workflow run for the failed checks and their details, then make any necessary updates.

Checklist items may remain unchecked while work is in progress. Please tick each item as you complete it.

If you used AI assistance, follow the project's Responsible AI use policy and provide the required disclosures.

https://icalendar.readthedocs.io/en/stable/contribute/development.html#format-code
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7.0.1
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7.0.1
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7.0.1
name: github-release
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7.0.1
- uses: actions/checkout@v7.0.1
- name: Create GitHub release from tag
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
uses: ncipollo/release-action@v1.21.0
zizmor 1.32.0 (the first release that reads the actions lockfile)
requires Python >= 3.11, while icalendar supports >= 3.10. uv therefore
failed to resolve the dev group on the 3.10 leg of every job
(venv creation aborted before any test ran). Mark the pin so it only
applies where zizmor can install; the zizmor workflow itself still
pip-installs 1.32.0 directly.

Verified with `uv lock`: the dev and docs groups now resolve across
the full requires-python range, with zizmor carrying the
python_full_version >= '3.11' marker.

Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lock GitHub Actions files

2 participants