diff --git a/.github/workflows/test-actions.yml b/.github/workflows/test-actions.yml index d214ddb..221ddbd 100644 --- a/.github/workflows/test-actions.yml +++ b/.github/workflows/test-actions.yml @@ -2,6 +2,13 @@ name: Test Actions on: push: + tags-ignore: + # Ignore release tags, as the install-slsactl will probably + # be executed before the release takes place, causing it to + # fail as it will try to download the binaries of the current + # release, which may or may not be available. + - 'v*' + pull_request: workflow_dispatch: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 807175f..92a9649 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,4 +29,6 @@ jobs: uses: actions/checkout@v4 - uses: ./actions/install-slsactl + with: + version: ${{ github.sha }} - run: make e2e diff --git a/actions/install-slsactl/action.yml b/actions/install-slsactl/action.yml index e4da0b6..f9ad9bb 100644 --- a/actions/install-slsactl/action.yml +++ b/actions/install-slsactl/action.yml @@ -49,6 +49,12 @@ runs: echo "Using last tag ${VERSION} as version" fi + if [[ ! "${VERSION}" =~ ^v ]]; then + echo 'Version is not 'latest' nor starts with "v". Fallback to go install with commit ID." + go install "github.com/rancherlabs/slsactl@${VERSION}" + exit $? + fi + echo "Downloading checksum file and signatures for release ${VERSION}" curl -LO "https://${REPO}/releases/download/${VERSION}/slsactl_${VERSION#v}_checksums.txt.pem" curl -LO "https://${REPO}/releases/download/${VERSION}/slsactl_${VERSION#v}_checksums.txt.sig"