Skip to content

Pin GitHub Actions to commit SHAs for ASF policy compliance#21

Merged
janhoy merged 6 commits into
apache:mainfrom
janhoy:asf-actions-compliance
May 25, 2026
Merged

Pin GitHub Actions to commit SHAs for ASF policy compliance#21
janhoy merged 6 commits into
apache:mainfrom
janhoy:asf-actions-compliance

Conversation

@janhoy
Copy link
Copy Markdown
Contributor

@janhoy janhoy commented May 23, 2026

Summary

Brings all GitHub Actions workflows into compliance with the ASF GitHub Actions policy.

  • Pin all action refs to commit SHAs — mutable tag refs (@v3, @v4) replaced with exact commit SHAs (tag retained as inline comment for readability)
  • Replace unapproved actionjbergstroem/hadolint-gh-action is not in the ASF approved list; replaced with hadolint/hadolint-action (approved in apache/infrastructure-actions)
  • Add permissions: contents: read to all active workflows (principle of least privilege)
  • Add compliance check workflow — new check-actions-usage.yml runs the ASF-provided reusable checker (sample) on every .github/** change

Actions pinned

Workflow Action SHA
dockerfile-lint actions/checkout f43a0e5 (v3)
dockerfile-lint hadolint/hadolint-action 2332a7b (v3.3.0)
docker-build actions/checkout 34e1148 (v4)
docker-build docker/setup-qemu-action c7c5346 (v3.7.0)
docker-build docker/setup-buildx-action 8d2750c (v3.12.0)
unit-test actions/checkout ee0669b (v2)
unit-test actions/checkout 34e1148 (v4)
unit-test ruby/setup-ruby afeafc3 (v1)
docs (disabled) all actions pinned

ASF policy requires all external actions be pinned to exact commit SHAs
rather than mutable tag references. Also replaces the unapproved
jbergstroem/hadolint-gh-action with hadolint/hadolint-action (approved in
apache/infrastructure-actions), adds explicit `permissions: contents: read`
to all workflows, and adds a new check-actions-usage workflow that runs
the ASF-provided compliance checker on every .github/** change.

See https://infra.apache.org/github-actions-policy.html
@janhoy janhoy requested a review from Copilot May 23, 2026 23:14
@janhoy janhoy requested a review from epugh May 23, 2026 23:14

This comment was marked as resolved.

janhoy added 4 commits May 24, 2026 01:40
PR apache#18 bumped the minimum Python version to >=3.12 but the Dockerfile
was still using python:3.11.2-slim, causing the Docker build to fail.
- Add --no-install-recommends to apt-get install calls (DL3015)
- Add WORKDIR /build before COPY in build-stage (DL3045)
- Replace backticks with \$() notation (SC2006)
- Use ./*.whl glob prefix (SC2035)
- Add --no-cache-dir to pip install (DL3042)
- Fix invalid label key DOCKERFILE -> org.label-schema.dockerfile (DL3048)
- Suppress DL3008 (apt version pinning) with ignore directives
Copy link
Copy Markdown

@epugh epugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parts of me are stargint to think GHA is more work than it's worth. They were amazing at one time, but these days.... It's a whole another maintainence things.

Okay, grumping aside, LGTM.

# Conflicts:
#	.github/workflows/docs.yml
@janhoy
Copy link
Copy Markdown
Contributor Author

janhoy commented May 25, 2026

parts of me are stargint to think GHA is more work than it's worth

I think the same would be the case with any other CI system. Supply chain attach hardening is needed no matter how we build. And dependabot takes care of upgrading and finding the sha hashes of new action versions, so not really that much work on a day to day basis.

@janhoy janhoy merged commit 3d58f5d into apache:main May 25, 2026
6 checks passed
@janhoy janhoy deleted the asf-actions-compliance branch May 25, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants