Our integration platform has forty partners who receive an email whenever we tag a release, with the notes generated from merged pull requests. The step lives in the same GitHub Actions workflow that builds and tests every push, and for a year it carried a single condition: if: ${{ startsWith(github.ref, 'refs/tags/v') }}.
In October a colleague wanted the email to go out only for tags pushed by hand, not for tags created by a re-run. He extended the line to if: ${{ startsWith(github.ref, 'refs/tags/v') }} && ${{ github.event_name == 'push' }}. It looked right, it read right, and two of us approved it.
The next morning a partner asked why they had received twenty three release announcements since nine o'clock, for versions that did not exist, listing work that was still on feature branches.
GitHub evaluates an if field as an expression. When the value contains ${{ }} with other text around it, the runner does not treat the whole thing as one expression.…