ci(dispatch): keep run artifacts out of the commit - #45
Merged
Conversation
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.
Every dispatch PR commits a
TASK.mdto the repo root. #41 is the currentexample: a 46-line
TASK.mdsits alongside the actual fix.Cause
The commit step strips one artifact but not the other:
TASK.mdis written by the "Build the task file" step and never removed, sogit add -Apicks it up. The reasoning already in the workflow for strippingPR_BODY.mdapplies word for word: it describes the change but is not a sourcechange.
TASK.mdis even further from source: it is the prompt the run wasgiven.
Change
Two layers, deliberately:
rm -f PR_BODY.md TASK.mdin the commit step, so the tree is clean./TASK.mdand/PR_BODY.mdin.gitignore, so a missed delete cannot landthem anyway.
The
.gitignoreentries are the guarantee and thermis the tidy-up. Anunattended workflow should not depend on remembering a delete: the declarative
rule holds even if the imperative one is edited away later. Both are anchored
with a leading
/so only the repo root is affected, never aTASK.mdthatbelongs to something else deeper in the tree.
Verification
dispatch.ymlparses, and the strip is asserted present in theCommit, push, open PRstep.git check-ignore -vconfirms the rules bind:Scope
.github/workflows/dispatch.ymland.gitignore. No Go code touched.Does not retroactively clean #41; that file is removed in that PR directly.