Skip to content

Commit

Permalink
Return an error if repo/ref not detected (#382)
Browse files Browse the repository at this point in the history
* return an error if repo/ref not detected

* Test detect-env

* remove debugging

Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
  • Loading branch information
ianlewis and laurentsimon committed Jun 24, 2022
1 parent d6c9fef commit 056b3f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/actions/detect-workflow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ func (a *action) getRepoRef(ctx context.Context) (string, string, error) {
ref = refParts[1]
}

if repository == "" {
return "", "", errors.New("no repository detected")
}
if ref == "" {
return "", "", errors.New("no ref detected")
}

return repository, ref, nil
}

Expand Down

0 comments on commit 056b3f1

Please sign in to comment.