-
Notifications
You must be signed in to change notification settings - Fork 602
Description
I'm not sure if it's possible for an action to distinguish between a value not being set or a value being set, but empty / nil, but opening a ticket, just in case. This could also be considered a bug in GitHub actions (more below).
I ran into a bug yesterday in one of our repositories using this action (moby/term#19). The repository had a workflow defined as below (simplified);
strategy:
matrix:
go-versions: [1.12.x, 1.13.x, 1.14.x]
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
CI seemed to be running fine, testing all versions:
However, on close inspection, it turned out we were only testing against the latest go version. The reason for that was that the go-version:
was empty:
The reason was that the matrix defined go-versions
(plural), but the action was looking for ${{ matrix.go-version }}
(singular), which would be a simple fix;
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -4,7 +4,7 @@ jobs:
matrix:
- go-versions: [1.12.x, 1.13.x, 1.14.x]
+ go-version: [1.12.x, 1.13.x, 1.14.x]
platform: [ubuntu-latest]
These things can be easy to miss though, as the action is silently ignoring this case; would it be possible to detect this situation and make the action fail ?