fix(ci): skip no-commit-to-branch; split build/deploy into conditional jobs#3
Merged
fix(ci): skip no-commit-to-branch; split build/deploy into conditional jobs#3
Conversation
The pre-commit hook is meant to block direct git commits to main during interactive use; on a push event in CI the commits already exist on main and the hook reports a false positive that blocks the post-merge image build/push to ghcr. Same pattern shared-workflows/opentofu.yml uses.
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
Hotfix for the post-merge Build of #2 plus a CI-flow restructure.
Changes
Skip
no-commit-to-branchin CI — thepre-commit/action@v3.0.1step now setsSKIP: no-commit-to-branch. The bundled hook is meant to block interactive commits tomain; in CI runs of pushes that already exist on main, it reported a false positive that blocked the post-merge image build/push to ghcr.Split into build / deploy jobs in a single workflow file.
buildah.ymlnow has three jobs:detectbuilddeployworkflow_dispatchfrom any branchPull request runs stop after
build. Push and dispatch runs proceed todeploy, which tagslatest+${{ github.sha }}and pushes toghcr.io/makeitworkcloud/<image>.Workflow shows up in the Actions sidebar as
Build. Each run displays the three-job DAG; the deploy job shows asskippedfor PR validation runs andsucceeded/failedfor push or manual runs.Why a single workflow rather than two files
Auto-deploy on merge to main + manual deploy from the Actions pane both want the exact same build. Putting them in one workflow means "validate, then publish" is a single visible Actions run rather than two disconnected ones.
After merging
The
paths: '!.github/**'exclusion means workflow-only changes don't auto-trigger the workflow. To rebuild + republish the newtfroot-runnerimage (which still hasn't been pushed because the original post-#2 run failed):The new
deployjob will run becauseworkflow_dispatchis now an unconditional trigger for it.