-
|
I have some trouble figuring out the syntax of Github Action expressions, and the documentation is not very clear on this. I know I can run a step only for tagged commits with
How do I inverse this, so it is only run if it is not a tag? The docs for expressions say |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
|
have you tried if: startsWith(github.ref, ‘refs/tags/’) != true or if: !(startsWith(github.ref, ‘refs/tags/’)) |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a lot, this worked: if: startsWith(github.ref, ‘refs/tags/’) != true The other variant with !(…) I had already tried, it gives a syntax error. |
Beta Was this translation helpful? Give feedback.
-
|
If you want to use ! in front of startsWith, you can put whole if condition inside double quotes: |
Beta Was this translation helpful? Give feedback.
-
|
It would be useful for GitHub to add an example. I had a hard time finding this. |
Beta Was this translation helpful? Give feedback.
-
|
Another one: if: ${{ ! startsWith(github.ref, 'refs/tags/') }}see detailed explanation in If (not) startswith mutually exclusive steps #26386. |
Beta Was this translation helpful? Give feedback.
have you tried
if: startsWith(github.ref, ‘refs/tags/’) != true
or
if: !(startsWith(github.ref, ‘refs/tags/’))