Comma-separated patterns for conclusion & state; remove 'all' from delete_workflow_pattern; various tweaks#16
Conversation
…nd will conflict with workflows named 'all'.
…epts them as integers, but their workflow syntax highlighter makes it clear they're meant to be strings.
|
Just did a force-push because I realized my text editor was trimming the 2 soft-line-breaks I added to |
|
Hi! Changes related to delete_workflow_pattern breaks compatibility. It requires extra code writing in a case with Options. E.g., withsparkle/service@9310d31 |
|
can anyone tell me why the following configuration delete all my workflow runs (including cancelled, failure, skipped and success)? - name: Delete runs by conclusion
uses: Mattraks/[email protected]
with:
retain_days: 0
keep_minimum_runs: 0
delete_run_by_conclusion_pattern: cancelledBTW, |
Uh, that is a very good question. The if check was altered from if (delete_run_by_conclusion_pattern && delete_run_by_conclusion_pattern.toLowerCase() !== "all"
&& run.conclusion.indexOf(delete_run_by_conclusion_pattern) === -1 ) {to if (delete_run_by_conclusion_pattern
&& delete_run_by_conclusion_pattern.split(",").map(x => x.trim()).includes(run.conclusion)
&& delete_run_by_conclusion_pattern.toUpperCase() !== "ALL") {I don't understand how that could somehow be resolving to |
|
This is a BREAKING CHANGE and should bump the tag to |
|
Well, I figured out the problem. I am the biggest dumbass in the universe and I feel terrible. It's not a breaking change, it's just a bug that wormed its way in when I was reformatting the code. The condition is supposed to be inverted. So it's deleting every run EXCEPT "cancelled" because I accidentally deleted a single exclamation point. I am really sorry, everyone. |
|
For what it's worth, I promise you all that I'm going to feel really shitty that I did this for a while. |
|
It's really okay, we all make mistakes. Anyway, thanks for your effort to improve this action. 🎉 |
delete_run_by_conclusion_patterncan now match multiple conclusions by using a comma-separated listdelete_workflow_by_state_patterncan now match multiple states by using a comma-separated listdelete_workflow_patternsince it's unnecessary and makes it unable to target workflows named 'all'delete_run_by_conclusion_patterna. uses a ternary expression within its job step parameter to resolve to
action_required,cancelled,failure,skippedOriginally I was only going to do the first item on the above list, but then I figured I should also apply it to the second item, and then I kept noticing other, smaller things that bothered me.
I organized all the changes by commit the best I could.