mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #989] Enhancement: Automatically disable unsupported cache actions #581
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#581
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sschuberth on GitHub (Feb 9, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/989
I realize
actdoes not support jobs that use caching actions. However, for user convenience I wonder whether the work-arounds (by leveragingif: ${{ !env.ACT }}) could be avoided by "patching" the original workflow definition.For example, if there was some (e.g. regex based) search & replace logic, code like
could automatically be replaced with
by omitting the final
cache: gradle. For for a more complex example, code likecould be replaced with
Such a replace logic could either be built into
actdirectly, or be freely configurable via some configuration file.@catthehacker commented on GitHub (Feb 24, 2022):
This is way too much work and almost impossible to get right
@domaslasauskas commented on GitHub (Mar 5, 2022):
As a workaround for the first example, you can set
cacheconditionally:Note: Empty string is considered
false, so it can't be first value and this wouldn't work:${{ env.ACT && '' || 'npm' }}@jamesdh commented on GitHub (Jun 15, 2022):
Plastering your workflow files with
if: ${{ !env.ACT }}is really not a solution, especially given the increasing number of tools that use caching or even how frequently justactions/cacheis used in ordinary workflows.Would it not be possible to just stub this out such that it always returns a negative cache hit, and thus essentially just skips the caching altogether?
@KnisterPeter commented on GitHub (Jun 15, 2022):
Since act is not only used for local execution this is not an option.
Also, for example the setup-node action, does use the toolkit cache which could not be easily stubbed.
@KnisterPeter commented on GitHub (Jun 15, 2022):
Instead it would be possible to implement chaching with the embedded artifact server.
But that would be up for the requestors to implement.
@sschuberth commented on GitHub (Nov 10, 2022):
Any hints at what parts of the code base would need to get touched?
@KnisterPeter commented on GitHub (Nov 10, 2022):
These: https://github.com/nektos/act/tree/master/pkg/artifacts 😉
.gitattributes#1510