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

Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.GITHUB_TOKEN #69

Closed
pqt opened this issue Mar 25, 2020 · 6 comments

Comments

@pqt
Copy link

pqt commented Mar 25, 2020

For some reason (might totally be me) I cannot get this workflow to run, it fails in setup

I can use other workflows fine that do similar things, but this action is the one I'd prefer to use. I tried the manual approach and the GitHub workflow helper UI. Both failed in similar fashion.

I also tried to add the following configuration but it failed in the same way.

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

References:

Since I'm deleting and testing on a throwaway repo, here's the exact configuration of my workflow for that given failure (with the env included, though the results are the same without)

# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  pull_request:
    types: ["opened", "edited", "reopened", "synchronize"]
  # push:
  #   branches: [ master ]
  # pull_request:
  #   branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      # Runs a single command using the runners shell
      - name: Run a one-line script
        run: echo Hello, world!

      # Runs a set of commands using the runners shell
      - name: Run a multi-line script
        run: |
          echo Add other actions to build,
          echo test, and deploy your project.

      # Runs a PR Linting Action
      - name: PR Lint GitHub Action
        uses: seferov/pr-lint-action@v1.1.0
        with:
          # Title regex to match
          title-regex: ^\[PROJECT-\d{3,}\] \ # default is ^\[PROJECT-\d*\]\
          # ${{ secrets.GITHUB_TOKEN }}
          # github-token: # optional
          # If set, on a failing job automatically closes pull request and comments on it with the given value
          # auto-close-message: # optional
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@pqt pqt changed the title Cannot use Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.GITHUB_TOKEN Mar 25, 2020
@seferov
Copy link
Owner

seferov commented Mar 26, 2020

thank you for the report.

I think the problem is with the regex. It should be enclosed with quotes.

- name: PR Lint GitHub Action
  uses: seferov/pr-lint-action@v1.1.0
  with:
    title-regex: '^\[PROJECT-\d{3,}\](\ )'
    github-token: ${{ secrets.GITHUB_TOKEN }}

@pqt
Copy link
Author

pqt commented Mar 26, 2020

🙄 I had a feeling I was missing something...

Going to take a look at this shortly and check back.

@pqt
Copy link
Author

pqt commented Mar 26, 2020

@seferov I wrapped it in quotes but it did not change the error message. It still fails to run.

seferov added a commit that referenced this issue Mar 26, 2020
@seferov
Copy link
Owner

seferov commented Mar 26, 2020

@pqt yes, the problem was with the version (v1.1.0). Please use v1.1.1. Here is the demo #72

@pqt
Copy link
Author

pqt commented Mar 26, 2020

Just tested it an can confirm it works as expected now!

🎉 Nicely done.

@seferov
Copy link
Owner

seferov commented Mar 27, 2020

thank you for the report.

@seferov seferov closed this as completed Mar 27, 2020
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

2 participants