Closed jaqx0r closed 1 year ago
Hey, happy new year!
Here's an example: https://github.com/caarlos0/goreleaser-action-v4-auto-snapshot-example
Hope it helps :)
I wonder if you can leave some comments in the README of that repo that explains the necessary parts that make it work?
Without context it's a bit hard to piece together what I need to copy into my own workflow.
I assume the good bits are the
- run: echo "flags=--snapshot" >> $GITHUB_ENV
- if: startsWith(github.ref, 'refs/tags/v')
run: echo "flags=" >> $GITHUB_ENV
and then
args: release --rm-dist ${{ env.flags }}
later on.
Is it sufficient to replace the first section with
- if: !startsWith(github.ref, 'refs/tags/v')
run: echo "flags=--snapshot" >> $GITHUB_ENV
or is there a good reason to have inverted the test?
Figured it out, and there's another example now in google/mtail#704
ahh, good one, lemme improve that in my example as well
Happy New Year!
In V3 and earlier, one could have the same workflow launched on a
pull_request
as well as atag
trigger, and in the former goreleaser-action would go into--snapshot
mode to allow the config to be tested. This was good as it meant one could test changes to the config in advance of merging and tagging.goreleaser-action@v4 seems to have regressed the feature for running with
--snapshot
when triggered bypull_request
and nottag
, breaking that feature.https://github.com/google/mtail/actions/runs/3764076951/jobs/6398151701 is a failed run on a pull request with V4 which includes the output:
Downgrading to V3, the workflow succeeds as see nin https://github.com/google/mtail/actions/runs/3814614109/jobs/6489047363
As you can see the downgrade to V3 includes the
--snapshot
flag in the commandline for goreleaser, and V4 no longer adds it, causing the tag lookup error.I presume this is related to #382 as that's intentionally changed this logic.
I'd like to preserve the behaviour in my workflow of performing a "dry" test of the goreleaser config so it isn't broken accidentally, and so that changes to the goreleaser config get correctly tested as a
pull_request
as well. How can I get the feature back?