Skip to content

Commit

Permalink
fix: continue when step doesn't have uses key
Browse files Browse the repository at this point in the history
  • Loading branch information
matty-rose committed Oct 24, 2021
1 parent 12040aa commit c6027f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pkg/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ func parseExternalActions(action *types.CompositeAction, data map[interface{}]in
return errors.New("step does not have a valid structure")
}

if _, ok := step["uses"].(string); !ok {
logrus.Debug("step uses key does not exist, or isn't a string, skipping")
continue
}

var ext types.ExternalAction

if stepName, ok := step["name"].(string); ok {
Expand Down
4 changes: 4 additions & 0 deletions pkg/parser/testdata/uses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ runs:
uses: actions/cache@v2
with:
path: ./
- name: dummy step
shell: bash
id: dummy
run: echo hello
- name: Cache test
uses: actions/[email protected]
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ package types

// ExternalAction represents a single external action that is used by the composite action.
type ExternalAction struct {
StepName string
StepID string
Creator string
Name string
Version string
StepName string
StepID string
}

0 comments on commit c6027f7

Please sign in to comment.