Skip to content

Commit

Permalink
Add known failing action blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinGrote committed May 2, 2021
1 parent 3ce7306 commit 523ad07
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/runner/step_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ func (sc *StepContext) Executor() common.Executor {
if remoteAction == nil {
return common.NewErrorExecutor(formatError(step.Uses))
}

// TODO: Add as remoteAction method?
unsupportedActionBlacklist := []string{
"actions/cache",
"actions/download-artifact",
"actions/upload-artifact",
}
actionName := remoteAction.Org + "/" + remoteAction.Repo
for _, blacklistItem := range unsupportedActionBlacklist {
if blacklistItem == actionName {
return func(ctx context.Context) error {
common.Logger(ctx).Warnf("SKIP: %v is not supported in act yet, sorry!", actionName)
return nil
}
}
}

if remoteAction.IsCheckout() && rc.getGithubContext().isLocalCheckout(step) {
return func(ctx context.Context) error {
common.Logger(ctx).Debugf("Skipping actions/checkout")
Expand Down
1 change: 1 addition & 0 deletions pkg/runner/step_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestStepContextExecutor(t *testing.T) {
"ubuntu-latest": "node:12.20.1-buster-slim",
}
tables := []TestJobFileInfo{
{"testdata", "uses-blacklist", "push", "", platforms, "linux/amd64"},
{"testdata", "uses-and-run-in-one-step", "push", "Invalid run/uses syntax for job:test step:Test", platforms, "linux/amd64"},
{"testdata", "uses-github-empty", "push", "Expected format {org}/{repo}[/path]@ref", platforms, "linux/amd64"},
{"testdata", "uses-github-noref", "push", "Expected format {org}/{repo}[/path]@ref", platforms, "linux/amd64"},
Expand Down
9 changes: 9 additions & 0 deletions pkg/runner/testdata/uses-blacklist/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: blacklisted-actions
on: push

jobs:
blacklist:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
- uses: actions/download-artifact@v2

0 comments on commit 523ad07

Please sign in to comment.