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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"

- name: Run packaging unit tests
run: python -m unittest discover -s tests -v

- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4

- name: Validate Docker Compose
run: IMAGE_VERSION="$(cat VERSION)" docker compose config
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v5
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"

- name: Run packaging unit tests
run: python -m unittest discover -s tests -v

- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4

- name: Prepare release metadata
id: release-meta
Expand Down Expand Up @@ -89,15 +89,15 @@ jobs:

- name: Log in to GHCR
if: steps.release-meta.outputs.publish == 'true'
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
id: build
uses: docker/build-push-action@v7
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
context: .
platforms: linux/amd64,linux/arm64
Expand Down
19 changes: 14 additions & 5 deletions tests/test_container_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,14 @@ def test_release_workflow_publishes_before_idempotent_release(self) -> None:
self.assertIn("--verify-tag", workflow)
self.assertIn("--latest", workflow)
self.assertNotIn("--prerelease", workflow)
# Pinned to a commit SHA (AUDIT.md #15); search for the pin plus
# its trailing version comment rather than the bare tag.
build_push_match = re.search(
r"uses: docker/build-push-action@[0-9a-f]{40} # v7", workflow
)
self.assertIsNotNone(build_push_match)
self.assertLess(
workflow.index("uses: docker/build-push-action@v7"),
build_push_match.start(),
workflow.index("name: Create or update GitHub Release"),
)

Expand All @@ -232,10 +238,13 @@ def test_workflows_use_current_docker_action_majors(self) -> None:
self.assertNotIn("docker/setup-buildx-action@v3", content)
self.assertNotIn("docker/build-push-action@v6", content)
self.assertNotIn("docker/login-action@v3", content)
self.assertIn("docker/setup-qemu-action@v4", content)
self.assertIn("docker/setup-buildx-action@v4", content)
self.assertIn("docker/build-push-action@v7", content)
self.assertIn("docker/login-action@v4", content)
# Pinned to commit SHAs (AUDIT.md #15); each assertion below
# matches the pin plus its trailing version comment, since the
# bare tag no longer appears as its own substring.
self.assertRegex(content, r"docker/setup-qemu-action@[0-9a-f]{40} # v4")
self.assertRegex(content, r"docker/setup-buildx-action@[0-9a-f]{40} # v4")
self.assertRegex(content, r"docker/build-push-action@[0-9a-f]{40} # v7")
self.assertRegex(content, r"docker/login-action@[0-9a-f]{40} # v4")
self.assertNotIn("--format '{{ .Digest }}'", content)
self.assertIn("--format '{{ .Manifest.Digest }}'", content)
self.assertIn("--output type=oci,dest=/tmp/mochad-ci-index.tar", content)
Expand Down