Skip to content

ci: use the shared scan-image and gate actions - #283

Merged
uniqueg merged 3 commits into
devfrom
ci/shared-actions
Oct 28, 2026
Merged

uniqueg merged 3 commits into
devfrom
ci/shared-actions

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Delete the local .github/actions/scan-image; ci.yml, release.yml and scan.yml use the shared elixir-cloud-aai/.github/actions/scan-image (same steps; the Trivy version is now its trivy-version input, default v0.75.0 as before; the shared action pins upload-sarif v4.39.1 instead of the local v4.39.0).
  • The gate passed ("CI passed") uses the shared elixir-cloud-aai/.github/actions/gate, with allow-skipped: push publish on pull requests only (as before); the gate job gets permissions: {} (as in FOCA). Job IDs and names unchanged, so no ruleset change.
  • Both pinned to the same full commit SHA on main as FOCA (10e8303…, comments # scan-image / # gate; .github has no releases). Dependabot: the /.github/actions/scan-image directory is dropped; / covers the pins.
  • Comments (.trivyignore.yaml, workflows) and docs/development.md updated; a new test (tests/test_workflows.py) checks that the workflows use no local actions, that shared actions are pinned to full SHAs, and that the gate passes toJSON(needs) to the shared gate.

Same rollout as elixir-cloud-aai/foca#553.

Closes #270
Closes #271

Verification

  • Reviews: adversarial and quality reviewers, two rounds, no high findings; the gate test now also asserts allow-skipped, all pins must name one SHA, Trivy bump guidance added to the docs.
  • pre-commit run on the changed files: passed (incl. actionlint, semgrep, ast-grep, mypy).
  • pytest: 1484 passed, 258 skipped (tests needing MongoDB/Helm, run in CI); the new test failed before the workflow change and passes after.
  • CI: all checks passed (run 40785302602), CI passed via the shared gate with push/publish skipped as allowed; Scan image via the shared scan-image action passed. Sourcery: reviewed, no threads.

Declined review findings

  • Docs/Dependabot comment claim that Dependabot updates the shared-action pins although .github has no tags: kept as in the merged FOCA rollout (#553); whether Dependabot bumps untagged SHA pins is not verified here and applies org-wide.
  • Checking the # gate / # scan-image pin comments in the test: YAML drops comments; noted in the test docstring.
  • Commit trailer model name: matches this session's attribution.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 3 commits October 28, 2026 23:04
Replace the local composite action `.github/actions/scan-image` with
the shared `elixir-cloud-aai/.github/actions/scan-image` in `ci.yml`,
`release.yml` and `scan.yml`, and the inline gate logic of `passed`
("CI passed") with the shared `gate` action (`push` and `publish` may
be skipped on pull requests only, as before). Both are pinned to the
same commit of `elixir-cloud-aai/.github` as in FOCA. The gate job gets
`permissions: {}`. Dependabot covers the pins via `/`; comments and
docs are updated, and a test checks that shared actions are pinned.

Closes #270
Closes #271

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Check `allow-skipped` of the gate and that all pins of the shared
actions name the same commit; say how to bump Trivy; reflow comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg added this to the v1.0.0-rc1 milestone Oct 28, 2026
@uniqueg
uniqueg marked this pull request as ready for review October 28, 2026 23:09
@sourcery-ai

sourcery-ai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Adopts the organization’s shared scan-image and gate actions, pinned consistently to one full commit SHA, while preserving existing CI and release behavior; Dependabot, workflow tests, and documentation are updated to enforce and explain the new arrangement.

File-Level Changes

Change Details Files
Replace repository-local image scanning with the organization’s shared, commit-pinned scan action across CI, release, and scheduled workflows.
  • Delete the local composite scan action.
  • Point all image scans at the shared action using the common full commit SHA.
  • Preserve scan inputs and isolation behavior while moving Trivy version ownership to the shared action.
.github/actions/scan-image/action.yml
.github/workflows/ci.yml
.github/workflows/release.yml
.github/workflows/scan.yml
Replace the custom CI result-checking shell script with the shared gate action while preserving workflow semantics.
  • Pass serialized job results through toJSON(needs).
  • Allow push and publish to be skipped only for pull requests.
  • Remove permissions from the gate job and retain its existing job ID and name.
.github/workflows/ci.yml
Add enforcement and dependency-management coverage for shared action adoption.
  • Manage shared-action pins from the repository root in Dependabot.
  • Test that workflows contain no local actions, use one full shared-action SHA, and configure the gate inputs correctly.
.github/dependabot.yml
tests/test_workflows.py
Update documentation and comments to describe the shared scanning implementation and maintenance process.
  • Reference the shared scan action and its commit pin.
  • Document that Trivy version changes occur in the shared action before pins are updated.
  • Refresh scan-related comments and ignore-file guidance.
docs/development.md
.trivyignore.yaml

Assessment against linked issues

Issue Objective Addressed Explanation
#270 Use the shared scan-image action in ci.yml, release.yml, and scan.yml while preserving the workflows’ existing scan configuration. ✅
#270 Delete the repository’s local .github/actions/scan-image copy. ✅
#270 Remove /.github/actions/scan-image from Dependabot’s monitored directories. ✅
#271 Replace the local gate logic in the CI passed job with the shared, commit-pinned elixir-cloud-aai/.github/actions/gate action, passing needs: ${{ toJSON(needs) }} and allowing only the intended jobs to be skipped based on the event. ✅
#271 Preserve the CI passed job’s name, always-run behavior, and needs list so the required check remains unchanged. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. The security scan did not finish, and the workflows now rely on a pinned external scanner and gate action, so a behavior difference that misses vulnerabilities or accepts a failed job could let an unsafe image proceed; reverting would not undo exposure from an image already published or used. The commit pin limits drift, but the shared action implementations are not part of this diff.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d20fb6d) to head (de8a5f3).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #283   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         2195      2195           
=========================================
  Hits          2195      2195           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg merged commit 614195c into dev Oct 28, 2026
19 checks passed
@uniqueg
uniqueg deleted the ci/shared-actions branch October 28, 2026 23:25
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.

ci: use the shared CI gate action ci: use the shared scan-image action

1 participant