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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
# Cancel superseded evidence for the same pull request or branch. This keeps the
# runner queue bounded during review-fix loops while preserving the newest head.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.repository }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

# Least-privilege default token (OSSF Scorecard: Token-Permissions).
permissions:
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/codeql.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Queue-bounding contracts for repository-owned GitHub Actions workflows."""

from pathlib import Path


ROOT = Path(__file__).resolve().parents[3]
WORKFLOWS = ROOT / ".github" / "workflows"


def test_ci_cancels_only_superseded_heads_from_the_same_pull_request() -> None:
workflow = (WORKFLOWS / "ci.yml").read_text(encoding="utf-8")

assert (
"group: ${{ github.workflow }}-${{ github.repository }}-"
"${{ github.event_name == 'pull_request' && "
"github.event.pull_request.number || github.run_id }}"
) in workflow
assert "cancel-in-progress: ${{ github.event_name == 'pull_request' }}" in workflow


def test_central_codeql_is_not_duplicated_locally() -> None:
assert not (WORKFLOWS / "codeql.yml").exists()
Loading