Repository navigation
Auto-commit dist/ fixes on any PR, not just Dependabot's - #496
Merged
Merged
Conversation
check-dist previously only failed loudly when a checked-in dist/ didn't match the build output; a separate patch-dependabot.yml worked around this for Dependabot PRs only by rebuilding, committing, and pushing the fix (then dispatching to re-trigger the other workflows, since a GITHUB_TOKEN push doesn't start a new run). Any other PR with a stale dist/ - e.g. one built with the wrong dependency versions locally - just failed with no path to green other than a manual fix. check-dist now does the rebuild-commit-push-dispatch dance itself for any same-repo pull_request (falling through to the existing fail+upload-artifact behavior for forks, and for pushes straight to main where there's no branch to push a fix to), so patch-dependabot.yml's logic is folded in and the file is removed. Renames the repository_dispatch event from dependabot-dist-updated to dist-autocommit to reflect the broader scope, updating the listeners in test.yml and codeql-analysis.yml. Pattern follows OpenModelica/openmodelica-library-testing-action#103. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> # Conflicts: # .github/workflows/check-dist.yml # .github/workflows/patch-dependabot.yml
AnHeuermann
force-pushed
the
ci/auto-commit-dist
branch
from
September 14, 2026 09:27
2a35427 to
f996f22
Compare
This was referenced Sep 14, 2026
AnHeuermann
added a commit
that referenced
this pull request
Sep 14, 2026
…_dispatch (#498) Verified #496 end-to-end with a throwaway test PR: check-dist correctly detected a stale dist/, rebuilt it, and pushed the fix as github-actions[bot]. But the re-trigger step used repository_dispatch, which always runs against the repository's default branch - it has no concept of "the branch that dispatched it". The dispatched runs showed up tagged to main, and the PR's actual head commit (the pushed fix) ended up with zero check runs beyond the CLA bot. Harmless today since this repo has no required status checks, but it defeats the entire point of auto-fixing: the PR looks unvalidated at its final SHA. workflow_dispatch accepts an explicit ref, so switch the re-trigger to `gh workflow run <file> --ref <branch>` for check-dist.yml, test.yml, and codeql-analysis.yml (each now declares workflow_dispatch so it can be dispatched this way), using the job's GITHUB_TOKEN via the actions: write permission dispatching needs. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #495 failed
check-distbecause its checked-indist/index.jshad been built with the wrong dependency versions locally (leftovernode_modulesfrom another branch), and there was no way for CI to self-heal that outside of Dependabot PRs.check-distnow rebuildsdist/, and if it differs from what's checked in on apull_requestfrom a same-repo branch, commits and pushes the fix itself, then dispatches adist-autocommitrepository event to re-trigger the other workflows on the new commit (aGITHUB_TOKENpush doesn't start a new run on its own).main(no branch to push a fix to) fall through to the previous behavior: fail the check and upload the expecteddist/as a workflow artifact.patch-dependabot.ymldid exactly this rebuild-commit-push-dispatch dance, but only for Dependabot PRs (gated ongithub.actor == 'dependabot[bot]'). Its logic is now folded intocheck-dist.ymland the file is removed.repository_dispatchevent fromdependabot-dist-updatedtodist-autocommitto reflect the broader scope; updates the listeners intest.ymlandcodeql-analysis.yml.Pattern follows OpenModelica/openmodelica-library-testing-action#103.
Test plan
dist/and confirmcheck-distauto-commits the fix and the re-triggered checks go greendist/auto-fixed now that the logic lives incheck-dist.ymlinstead ofpatch-dependabot.yml