Skip to content

if condition rejected by GitHub not flagged #83

@ekohl

Description

@ekohl

Want to help get this issue implemented? Donate to the action-validator code fund.


From https://github.com/theforeman/foreman_dhcp_browser/blob/e80fc0e5ffdc1f30ba23ebf3ad9314b456dea06e/.github/workflows/release.yml#L14 there's this bit:

jobs:
  release:
    if: github.repository_owner == "theforeman"

When running it I see

 Invalid workflow file: .github/workflows/release.yml#L14
The workflow is not valid. .github/workflows/release.yml (Line: 14, Col: 9): Unexpected symbol: '"theforeman"'. Located at position 28 within expression: github.repository_owner == "theforeman"

But with action-validator 0.6.0 I see:

$ wget https://github.com/mpalmer/action-validator/releases/download/v0.6.0/action-validator_linux_amd64
$ chmod +x action-validator_linux_amd64
$ ./action-validator_linux_amd64 release.yml
$

I also verified that if I explicitly create an error it is shown.

Reading https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/using-conditions-to-control-job-execution#example-only-run-job-for-specific-repository I see I should have used single quotes:

jobs:
  release:
    if: github.repository_owner == 'theforeman'

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-fundThis issue is part of "code fund"; see https://hezmatt.org/~mpalmer/code-fund.htmlpr-welcomeThis would be a good fix/feature, but the maintainer isn't planning on doing the work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions