I am using a couple different Github workflows including one that should only run on official releases. Inside the .github/workflows/release.yml
is this on
condition:
on:
push:
tags:
- 'v*'
However, this can still run if someone on our team accidentally (or purposely) pushes a tag from the develop
branch. Ideally, we would want to lock this down so that the tag MUST be on the main
branch (since that is protected), and maybe even further, it would be nice if we could ensure that the tags are only referencing the specific merge commit relating to the corresponding release. For example, if I run
git branch --contains tags/v1.2.3
this would normally output the main
branch where I made the tag. Can I add a condition to the github workflow to check the output of that?
Looking at the Github action documentation it is not clear if multiple conditions are evaluated using a logical AND or a logical OR.