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

how to add runner labels #76

Open
CvH opened this issue Jul 14, 2022 · 3 comments
Open

how to add runner labels #76

CvH opened this issue Jul 14, 2022 · 3 comments

Comments

@CvH
Copy link

CvH commented Jul 14, 2022

We are using runner labels and get errors like

[actionlint] reported by reviewdog 🐶
label "scripts" is unknown. available labels are "windows-latest", "windows-2022", "windows-2019", "windows-2016", "ubuntu-latest", "ubuntu-22.04", "ubuntu-20.04", "ubuntu-18.04", "macos-latest", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "macos-10.15", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file [runner-label]

if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file [runner-label]

is there a possibility to pass this option to actionlint?

@sammcj
Copy link

sammcj commented Sep 19, 2022

Having this issue as well, it looks like reviewdog doesn't provide a way to pass labels in or a config file.

@sammcj
Copy link

sammcj commented Sep 19, 2022

I've got a pretty gross workaround - but it does work, you can create a temporary config file for the action to use.

Here's an example using a reusable workflow I created:

name: Lint Actions Workflows

# ensure you set secrets to inherit

on:
  workflow_call:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - 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:
              - my-self-hosted-runner-1
              - my-self-hosted-runner-2
          EOF
      - uses: reviewdog/action-actionlint@v1
        with:
          actionlint_flags: -ignore SC2086 -config-file .github/actionlint.yaml
          fail_on_error: true
          level: error
          reporter: github-pr-review
        env:
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@arizz96
Copy link

arizz96 commented Aug 29, 2024

Hey there, I found a similar issue these days, I solved by creating the .github/actionlint.yaml myself, instead of letting the CI step doing it.
The doc is available here.
Hope this helps 💪

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

3 participants