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

See original GitHub issue

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 }}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
seferovcommented, Mar 27, 2020

thank you for the report.

0reactions
pqtcommented, Mar 26, 2020

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

🎉 Nicely done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Action doesn't understand the 'secrets' syntax copied ... - GitHub
“##[error](Line: 7, Col: 18): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.GALAXY_API_KEY”.
Read more >
Secret interpolation is giving syntax error in caller workflow ...
I was passing a secret in the wrong way. In my workflow, the secrets were passed using the with input parameter hence the...
Read more >
unrecognized named-value: 'secrets'. located at position 1 ...
I'm trying to pass in a secrets variable as input to my Github Action and I am getting the following error: “##[error](Line: 7,...
Read more >
GitHub Actions Security Best Practices [cheat sheet included]
Set minimum scope for credentials; Use specific action version tags; Don't use plain-text secrets; Don't reference values that you don't ...
Read more >
Secrets in GitHub Actions - Octopus Deploy
March 1, 2022 • 4 mins. In simple terms, a 'secret' is data that's encrypted and hidden from view, but still useable in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found