Skip to content

ci(repo): add a reusable workflow that commits an artifact - #272

Merged
xsahil03x merged 33 commits into
mainfrom
ci/commit-artifact-workflow
Nov 30, 2026
Merged

xsahil03x merged 33 commits into
mainfrom
ci/commit-artifact-workflow

Conversation

@xsahil03x

@xsahil03x xsahil03x commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Why

Since #271, a job that commits generated files renders on a free runner and hands the files to a job on github-public-amd64, the only runners the org IP allow list lets call the GitHub API. That second job mints the CI bot token, downloads the artifact and runs bot-commit: about 30 lines, repeated in update_goldens (core, chat, chat-ai, video) and update_size_badges (chat, video).

Changes

  • commit_artifact.yml: a reusable workflow (workflow_call) on github-public-amd64 that commits an artifact of the calling run through bot-commit. Inputs artifact, files, message, client-id, optional branch and expected-head-sha; the app key comes in as the private-key secret, not secrets: inherit, and the minted token only gets contents: write. Outputs changed, commit, moved.
  • update_goldens calls it; its commit job goes from 30 lines to 9.

Validation

  • update_goldens on a branch with one golden deleted (run): the called job committed exactly that file back as a verified bot commit, byte-identical to the original. On an unchanged branch it found nothing to commit (run).
  • Called from stream-chat-flutter-ai by SHA (an earlier commit of this PR, before the token was scoped), with that repository's own CI bot variable and secret: it committed a file to a throwaway branch, and on the run that commit triggered, found nothing to commit.

🤖 Generated with Claude Code

xsahil03x and others added 12 commits November 27, 2026 14:29
The org IP allow list refuses GITHUB_TOKEN writes from standard runners
but not reads of this public repository, so jobs that only read keep
actions/checkout and move to ubuntu-latest. Jobs that push, tag, release,
comment or label stay on the static-IP group.

Checkouts no longer persist the token unless a later step pushes with
git, and every external action is pinned to a commit SHA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The job only reads the repository, which the IP allow list permits from
standard runners, so it returns to macos-latest from scaleway-macos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the iOS build, the job only reads the repository, so it returns to
macos-latest from scaleway-macos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bot-commit and flutter-web-pr-comment call the GitHub API, which the org
IP allow list refuses from standard runners. The flutter-web deploy,
remove and target actions make no GitHub call and run anywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "/" directory covers only .github/workflows, so the actions under
.github/actions, which other repositories run, were left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop `pull-requests: read` where no step reads pull requests.
- Upload only the listed coverage files, so Codecov stops picking up an
  IDE run configuration as a report.
- Name action-slack's pin by the release it matches (v3.19.0), so
  Dependabot can compare it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
update_goldens renders on the static-IP runners' ubuntu-24.04, while
ubuntu-latest is now 26.04, so test pins 24.04 to keep regenerated
goldens matching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
update_goldens rendered on the static-IP group, whose image an admin can
change without us noticing. It now renders on ubuntu-24.04, the image
`test` compares on, and only the commit through the API runs on the
static-IP group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both jobs are on free runners now, so they follow the same label without
a pinned image to bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Building and deploying to Google Cloud make no GitHub API call, so the
PR, beta and prod gallery deploys move to ubuntu-latest. Only the steps
that call GitHub stay on the static-IP group: the PR comment, and the
gh-pages push, which now commits a build made in a separate job instead
of building inside flutter-gh-pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jobs that render or generate files on a free runner hand them to this
workflow, which commits them with bot-commit from the static-IP runners,
the only ones the org IP allow list lets call the GitHub API. Saves each
caller the token, checkout and download boilerplate. update_goldens is
the first caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xsahil03x
xsahil03x requested a review from a team as a code owner November 27, 2026 14:36
@github-actions github-actions Bot added the ready Pull request ready to be reviewed label Nov 27, 2026
xsahil03x and others added 14 commits November 27, 2026 15:38
The GitHub Pages build also uses the bootstrap action, as the
flutter.getstream.io deploy beside it does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
flutter.getstream.io/design-system hosts the gallery's beta and prod
builds, and nothing links to the GitHub Pages copy, so the gh-pages
build and push go, along with their static-IP job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With an empty token, paths-filter diffs pull requests with git against
the base branch instead of the GitHub API, which the org IP allow list
refuses from standard runners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pull request's test merge commit has the base branch as its first
parent, so diffing the last two commits lists the pull request's
changes without paths-filter or a token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without --no-renames git lists a moved file only under its new path, so a
pull request moving a file out of packages/ skipped the analysis, unlike
paths-filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
detect_changes.yml tells whether a pull request or push changes any of
the given globs, diffing with git instead of the GitHub API that
dorny/paths-filter calls, so gates run on free runners without a token.
Chat and chat-ai gate five workflows with paths-filter and can switch to
it. The legacy-analysis gate is the first caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…workflows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jobs that main's ruleset requires as status checks keep their IDs as
their names, since a required check is matched by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Run the legacy analysis when its gate fails: a skipped required check
  passes, so a broken gate would have let every pull request through.
  detect_changes.yml's example now shows the same condition.
- Run it when a draft is marked ready for review, which kept the skipped
  check green until the next push.
- Queue the pull request web build's comment jobs in one group, so a late
  link comment can't overwrite "removed".
- Note in CLAUDE.md which jobs need the static-IP runners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from ci/standard-runners to main November 27, 2026 16:30
…rkflow

# Conflicts:
#	.github/workflows/update_goldens.yml
#	CLAUDE.md
xsahil03x and others added 3 commits November 27, 2026 17:32
bot-commit at #271's merge pins its own github-script by SHA, and the
minted token only gets `contents: write`, all bot-commit needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…other workflows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rkflow

# Conflicts:
#	.github/workflows/update_goldens.yml
Comment thread .github/workflows/commit_artifact.yml Resolved
@github-actions github-actions Bot added approved Approved by a reviewer and removed ready Pull request ready to be reviewed labels Nov 30, 2026
xsahil03x and others added 2 commits November 30, 2026 14:38
Nothing in it uses the job token, and a called workflow can't raise the
caller's permissions, so asking for `contents: read` would reject callers
that grant none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xsahil03x
xsahil03x merged commit 5f0f7c8 into main Nov 30, 2026
21 checks passed
@xsahil03x
xsahil03x deleted the ci/commit-artifact-workflow branch November 30, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Approved by a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants