Skip to content

ci: pin GitHub Actions to full-length commit SHAs - #57

Merged
devops-thiago merged 1 commit into
masterfrom
ci/pin-actions-to-sha
Jul 28, 2026
Merged

ci: pin GitHub Actions to full-length commit SHAs#57
devops-thiago merged 1 commit into
masterfrom
ci/pin-actions-to-sha

Conversation

@devops-thiago

Copy link
Copy Markdown
Owner

The repository now only permits official/verified actions and requires every action to be pinned to a full-length commit SHA. All 16 uses: entries referenced floating tags, so both workflows were being rejected.

  • Pin every action to its release commit SHA, with a trailing version comment so the intended version stays readable:
    actions/checkout v3 -> v7.0.1 (3d3c42e)
    actions/setup-java v3 -> v5.6.0 (03ad4de)
    actions/cache v3 -> v6.1.0 (55cc834)
    actions/upload-artifact v4 -> v7.0.1 (043fb46)
    codecov/codecov-action v3 -> v7.0.0 (fb8b358)
  • Rename the Codecov file input to files; file was removed in v4.
  • Add permissions: contents: read to both workflows so jobs stop
    running with the default write-capable token.
  • Add persist-credentials: false to checkout so the token is not left
    behind in .git/config. Nothing in either workflow pushes.
  • Add the github-actions ecosystem to Dependabot, grouped and weekly, so
    the new pins get bumped instead of silently rotting.

Job graphs, step order and Maven commands are unchanged.

The repository now only permits official/verified actions and requires
every action to be pinned to a full-length commit SHA. All 16 `uses:`
entries referenced floating tags, so both workflows were being rejected.

- Pin every action to its release commit SHA, with a trailing version
  comment so the intended version stays readable:
    actions/checkout        v3 -> v7.0.1 (3d3c42e)
    actions/setup-java      v3 -> v5.6.0 (03ad4de)
    actions/cache           v3 -> v6.1.0 (55cc834)
    actions/upload-artifact v4 -> v7.0.1 (043fb46)
    codecov/codecov-action  v3 -> v7.0.0 (fb8b358)
- Rename the Codecov `file` input to `files`; `file` was removed in v4.
- Add `permissions: contents: read` to both workflows so jobs stop
  running with the default write-capable token.
- Add `persist-credentials: false` to checkout so the token is not left
  behind in .git/config. Nothing in either workflow pushes.
- Add the github-actions ecosystem to Dependabot, grouped and weekly, so
  the new pins get bumped instead of silently rotting.

Job graphs, step order and Maven commands are unchanged.
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@thrillhousebot

Copy link
Copy Markdown

🤖 ThrillhouseBot PR Summary

What this PR does

This change pins every GitHub Action in both CI workflows to a full-length commit SHA, adds top-level read-only repository permissions, sets persist-credentials to false on all checkout steps, renames the Codecov file input to files, and introduces a Dependabot configuration for the github-actions ecosystem with weekly grouping to keep the pins fresh.

Changes Overview

  • Files changed: 3
  • Lines added: +79
  • Lines removed: -46

Changed Files

File Change Summary
.github/dependabot.yml Modified Add github-actions ecosystem with weekly schedule, grouping, and reviewer/assignee configuration.
.github/workflows/ci.yml Modified Add top-level permissions, pin all action SHAs, add persist-credentials to checkout, rename codecov file input to files.
.github/workflows/pr-validation.yml Modified Add top-level permissions, pin all action SHAs, add persist-credentials to checkout, rename codecov file input to files.

Risk Assessment

Risk Count
🔴 Critical 0
🟠 High 0
🟡 Medium 0
🔵 Low 0

No new issues found in this PR, but the review cannot be approved until CI is confirmed green.

⚠️ CI Checks Status

Some checks are still pending or have failed:

Check Type Status Detail
validate check-run ⏳ Pending -
Test and Analysis check-run ⏳ Pending -

Automated review by ThrillhouseBot. Reply with /review to re-run.

@thrillhousebot thrillhousebot Bot added the dependencies Pull requests that update a dependency file label Jul 28, 2026
@devops-thiago
devops-thiago merged commit 51aaf61 into master Jul 28, 2026
6 checks passed
@devops-thiago
devops-thiago deleted the ci/pin-actions-to-sha branch July 28, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant