Skip to content

if condition rejected by GitHub not flagged #83

Open

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'

Activity

  1. added
    pr-welcomeThis would be a good fix/feature, but the maintainer isn't planning on doing the work
    on Jan 25, 2025
  2. mpalmer commented on Jan 25, 2025

    @mpalmer
    Owner

    Yeah, we don't do any validation of the contents of fields at present, with the exception of a couple of special cases like paths. A PR implementing such validation would be warmly received.

  3. added
    code-fundThis issue is part of "code fund"; see https://hezmatt.org/~mpalmer/code-fund.html
    on Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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