Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
- name: Set up uv
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/test_github_release_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@

from __future__ import annotations

import re
from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[2]
WORKFLOW = REPO_ROOT / ".github" / "workflows" / "release.yml"


def test_release_workflow_pins_actions_to_immutable_commits() -> None:
"""Actions with release write permissions must not follow mutable tags."""
workflow = WORKFLOW.read_text(encoding="utf-8")
action_refs = re.findall(r"\buses:\s*([^\s#]+)", workflow)

assert action_refs
assert all(re.fullmatch(r"[^@]+@[0-9a-f]{40}", ref) for ref in action_refs)


def test_release_workflow_publishes_only_labeled_merged_main_prs() -> None:
"""The PR label is the sole release-qualification signal."""
workflow = WORKFLOW.read_text(encoding="utf-8")
Expand Down
Loading