Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 1, 2026

GitHub Actions reported syntax error at line 24: Unrecognized named-value: 'secrets' in the release workflow. The secrets context cannot be accessed directly in step-level if conditionals.

Changes

  • Map secrets.RELEASE_TOKEN to step environment variable
  • Use negation operator on env variable instead of string comparison against secret

Before:

- name: Validate RELEASE_TOKEN
  if: ${{ secrets.RELEASE_TOKEN == '' }}
  run: |

After:

- name: Validate RELEASE_TOKEN
  if: ${{ !env.RELEASE_TOKEN }}
  env:
    RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
  run: |

The negation operator handles empty, null, and undefined cases correctly per GitHub Actions context evaluation rules.

Original prompt

This section details on the original issue you should resolve

<issue_title>Check failure on line 24 in . github/workflows/release. yml: Unrecognized named-value 'secrets'</issue_title>
<issue_description>## Workflow failure in .github/workflows/release.yml

GitHub Actions reports the following error:

Invalid workflow file
(Line:  24, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets. RELEASE_TOKEN == ''

File:

  • .github/workflows/release.yml (Failure at line 24)

Relevant Code Section

23|       - name: Validate RELEASE_TOKEN
24|         if: ${{ secrets.RELEASE_TOKEN == '' }}
25|         run: |
26|           echo "::error:: RELEASE_TOKEN secret is required for the release workflow"
27|           echo "::error::The default GITHUB_TOKEN cannot create pull requests"
28|           echo "::error::Please follow the setup instructions in docs/RELEASE-PROCESS.md"
29|           echo ":: error::See https://github.com/${{ github.repository }}/blob/${{ github.event.repository. default_branch }}/docs/RELEASE-PROCESS.md"
30|           exit 1

Steps to Reproduce

  1. Trigger the relevant workflow (e. g., release action).
  2. Observe failure in GitHub Actions for .github/workflows/release.yml.

Expected Behavior

Workflow should parse all expressions validly and run without error.

Actual Behavior

The workflow fails with an 'Unrecognized named-value: secrets' error in an if conditional at line 24.

Suggested Next Steps

  • Review usage of secrets.RELEASE_TOKEN in the workflow.
  • Ensure that the context reference is correctly structured and the secret is available at runtime.
  • See GitHub Actions - Contexts and expression syntax for additional guidance. </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 1, 2026 21:10
- Changed line 24 from `if: ${{ secrets.RELEASE_TOKEN == '' }}` to `if: ${{ env.RELEASE_TOKEN == '' }}`
- Added env mapping to expose secret to the step's environment
- This resolves the "Unrecognized named-value: 'secrets'" error
- Validated with actionlint - all workflows now pass validation

Co-authored-by: archubbuck <3529902+archubbuck@users.noreply.github.com>
- Changed from `env.RELEASE_TOKEN == ''` to `!env.RELEASE_TOKEN`
- This handles empty, null, and undefined cases more robustly
- Cleaner and more idiomatic GitHub Actions syntax

Co-authored-by: archubbuck <3529902+archubbuck@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unrecognized named-value 'secrets' in release.yml Fix: Invalid secrets context in release workflow conditional Jan 1, 2026
Copilot AI requested a review from archubbuck January 1, 2026 21:13
@archubbuck archubbuck marked this pull request as ready for review January 1, 2026 21:19
@archubbuck archubbuck merged commit b65c8ae into main Jan 1, 2026
5 checks passed
@archubbuck archubbuck deleted the copilot/fix-release-workflow-error branch January 1, 2026 21:19
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

Successfully merging this pull request may close these issues.

Check failure on line 24 in . github/workflows/release. yml: Unrecognized named-value 'secrets'

2 participants