Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues using actionlint_flags with the -ignore flag? #80

Open
pcassaretto-cmc opened this issue Aug 26, 2022 · 5 comments
Open

issues using actionlint_flags with the -ignore flag? #80

pcassaretto-cmc opened this issue Aug 26, 2022 · 5 comments

Comments

@pcassaretto-cmc
Copy link

pcassaretto-cmc commented Aug 26, 2022

With the following

  with:
    actionlint_flags: -ignore 'a pattern' 

actionlint seems to run without producing any findings whatsoever but reports no errors. I noticed in the logs

"/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/repo/repo":"/github/workspace" ghcr.io/reviewdog/action-actionlint:v1.28.0
could not read "pattern'": open pattern': no such file or directory
2022/08/26 15:13:25 [actionlint] reported: https://github.com/org/repo/runs/_id_ (conclusion=success)

so it appears to try and open a file with the name of the last word in the pattern to be ignored. I have tried different approaches surrounding the flag value in different quotes to no avail?

What am I doing wrong?

@shogo82148
Copy link
Collaborator

Can we have whole contents of your .github/workflow/*.yaml?

@shichanson
Copy link

I also encountered this problem. Don't know how to solve this problem.

name: "test"

on:
  pull_request:
    branches:
      - master
    paths:
      - ".github/workflows/**"

jobs:
  actionlint:
    runs-on: ["self-hosted"]
    steps:
      - uses: actions/checkout@v3
      - uses: reviewdog/action-actionlint@v1
        with:
          actionlint_flags: -ignore 'label ".+" is unknown' -ignore '".+" is potentially untrusted'
          reporter: github-pr-review

@pcassaretto-cmc
Copy link
Author

The workflow @shichanson posted is a great example. I think this issue actually breaks actionlint checking the workflow itself, as no errors in the workflow are reported whatsoever if flags are specified that would only ignore a subset of the errors

@shichanson
Copy link

@pcassaretto-cmc Don't say how I use it, there is no doubt that you are a bug. My usage scenario is that I don't want to check my runner label because I have a lot of runners. My github is deployed privately.

@sammcj
Copy link

sammcj commented Dec 23, 2022

My workaround for this problem is to generate a config file on the fly before the check is run:

      - uses: actions/checkout@v3
      - name: build actionlint config for runner labels
        shell: bash
        run: |
          cat > .github/actionlint.yaml<< EOF
          self-hosted-runner:
            # Labels of self-hosted runner in array of string
            labels:
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
              - aws-redacted-1233456790
          EOF
      - uses: reviewdog/action-actionlint@v1
        env:
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SHELLCHECK_OPTS="-e SC2086 -e SC2129 -e SC1091 -e SC2050 -e SC2194 -e SC2154 -e SC2157"
        with:
          actionlint_flags: -config-file '.github/actionlint.yaml'
          fail_on_error: true
          level: error
          reporter: github-pr-review
          filter_mode: file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants