actionlint
actionlint copied to clipboard
Single quote check is missed in presence of ${{ }} in if
Minimal example:
name: test
on:
push:
jobs:
x:
runs-on: ubuntu-latest
if: ${{ github.repository }} == "a/a"
steps:
- name: a
run: echo "a"
This doesn't emit any errors.
However, there is an error about double quotes if you replace ${{ github.repository }}
with github.repository
, which seems like the right behavior based on https://github.com/actions/runner/issues/866. Would it make sense to emit the same error when ${{ github.repository }}
is used?
This is very edge case of if:
usage. if:
specially allow an expression without ${{ }}
in its body so it allows nesting ${{ }}
but actionlint is not supporting that.
In your example, including the equal expression within a single ${{ }}
would be cleaner.
if: ${{ github.repository == 'a/a' }}