Skip to content

Add reusable build workflow invocation for spel CI - #79

Merged
lorengordon merged 6 commits into
mainfrom
feat/spel-build-workflow
Sep 29, 2026
Merged

lorengordon merged 6 commits into
mainfrom
feat/spel-build-workflow

Conversation

@lorengordon

@lorengordon lorengordon commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Description:

Adds .github/workflows/build.yml, which invokes spel's new workflow_call-triggered reusable build workflow to run ephemeral/on-demand AMI builds directly from this repo, without needing to push changes to spel first.

  • Triggers on workflow_dispatch (with optional SPEL_VERSION, SPEL_FORCE, SPEL_BUILDERS, SPEL_PROJECTS overrides) and on PR review comments containing /build.
  • A prepare job computes defaults (full builder/project matrix, date+sha version) and builds the JSON-encoded AMIGEN9_SOURCE pointing at the PR head branch (for review-triggered builds) or the pushed ref otherwise.
  • A build job calls plus3it/spel/.github/workflows/build.yml via uses:, passing the computed inputs through.

Rationale:

Currently, testing amigen9 changes against spel's build pipeline requires opening a PR against spel itself. This workflow lets contributors trigger a full spel-driven AMI build directly from an amigen9 branch or PR, using amigen9's own CodeBuild-hosted runners.

plus3it/spel#839 (feat/workflow-call-support), which adds workflow_call support to spel's build workflow, has now merged into spel's master. The build job is pinned to that merge commit (525049d).

Permissions fix:

After re-pinning to the real merge commit, the build job started failing workflow validation with:

Invalid workflow file: .github/workflows/build.yml#L99
The workflow is not valid. .github/workflows/build.yml (Line: 99, Col: 3): Error calling workflow 'plus3it/spel/.github/workflows/build.yml@525049d...'. The nested job 'release-pr' is requesting 'contents: write, pull-requests: write', but is only allowed 'contents: read, pull-requests: none'.

This is confirmed as a known, by-design GitHub Actions limitation, not a bug in this workflow: GitHub statically validates the permissions declared by every job in a called reusable workflow's graph against the caller's granted permission ceiling at workflow-parse time, before any if: conditions are evaluated at runtime. spel's release-pr job declares contents: write, pull-requests: write and is only gated to run via if: (never true for amigen9's triggers), but its declared permissions still had to fit within the ceiling amigen9 granted.

References:

Fixed by adding a job-level permissions: override on the build job granting contents: write and pull-requests: write, matching spel's ceiling requirement. These elevated permissions are never actually exercised since release-pr never runs for amigen9's triggers.

Reference Issue:

N/A

plus3it/spel#839 (feat/workflow-call-support) has merged into master at
525049d. Point the build job there instead of the PR branch tip.
lorengordon

This comment was marked as outdated.

GitHub Actions statically validates permissions for every job in a
called reusable workflow's graph, including jobs gated by an if:
condition that will never actually run in this context. spel's
release-pr job declares contents: write and pull-requests: write, so
the build job here must grant at least that ceiling or the workflow
call is rejected at validation time, even though release-pr only
runs for spel's own schedule/SPEL_RELEASE triggers.

See actions/runner#4151 and
https://github.com/orgs/community/discussions/63736 for confirmation
this is a known, by-design GitHub Actions limitation.
lorengordon

This comment was marked as outdated.

The CodeBuild GitHub webhook integration gates on the workflow job's
parent workflow name, which must be exactly 'Build images' (matching
spel's own top-level workflow name) for the webhook to trigger
CodeBuild-hosted runners. Renamed from 'Build AMIs via spel' to match.
lorengordon

This comment was marked as outdated.

lorengordon

This comment was marked as outdated.

@lorengordon
lorengordon marked this pull request as ready for review September 29, 2026 14:51
@lorengordon
lorengordon requested a review from a team September 29, 2026 14:51
eemperor
eemperor previously approved these changes Sep 29, 2026
@mergify

mergify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

lorengordon

This comment was marked as outdated.

@lorengordon
lorengordon force-pushed the feat/spel-build-workflow branch from 82bc40b to f9d09b0 Compare September 29, 2026 16:14

@lorengordon lorengordon left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

/build

@lorengordon
lorengordon force-pushed the feat/spel-build-workflow branch from f9d09b0 to 2b51a5e Compare September 29, 2026 17:48

@lorengordon lorengordon left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

/build

@lorengordon
lorengordon merged commit 00465fb into main Sep 29, 2026
39 of 43 checks passed
@lorengordon
lorengordon deleted the feat/spel-build-workflow branch September 29, 2026 19:42
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.

2 participants