Skip to content

fix: add github.event_name to JS allowed expressions list#22084

Merged
pelikhan merged 2 commits intomainfrom
copilot/investigate-github-event-name
Mar 21, 2026
Merged

fix: add github.event_name to JS allowed expressions list#22084
pelikhan merged 2 commits intomainfrom
copilot/investigate-github-event-name

Conversation

Copy link
Contributor

Copilot AI commented Mar 21, 2026

github.event_name was present in the Go AllowedExpressions constant but missing from the JavaScript ALLOWED_EXPRESSIONS array in runtime_import.cjs, causing the activation job to fail at the "Interpolate variables and render templates" step when workflows referenced ${{ github.event_name }}.

Changes

  • runtime_import.cjs: Add "github.event_name" to ALLOWED_EXPRESSIONS; add event_name: context.eventName to the runtime evaluation context so the expression resolves to its actual value rather than being passed through as a raw expression
  • runtime_import.test.cjs: Add eventName to mock context; add isSafeExpression and evaluateExpression coverage for github.event_name

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git e/git init�� k/node_modules/.-u git tions/setup/js/node_modules/.bin/git user.email test@example.comcheckout /git git bran�� -M main k/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/git /tmp/bare-incremgit gin/feature-branadd cal/bin/git git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/23372042508/job/67997664087#step:12:1

Investigate whether github.event_name is an allowed variable


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Investigate whether github.event_name is an allowed variable fix: add github.event_name to JS allowed expressions list Mar 21, 2026
Copilot AI requested a review from pelikhan March 21, 2026 04:42
@pelikhan pelikhan marked this pull request as ready for review March 21, 2026 04:46
Copilot AI review requested due to automatic review settings March 21, 2026 04:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes runtime import expression interpolation failures when workflows reference ${{ github.event_name }} by aligning the JavaScript runtime allowlist/context with the existing Go AllowedExpressions.

Changes:

  • Add github.event_name to the JavaScript ALLOWED_EXPRESSIONS allowlist.
  • Map github.event_name to the real runtime value via event_name: context.eventName in the evaluation context.
  • Extend tests to cover isSafeExpression and evaluateExpression behavior for github.event_name.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
actions/setup/js/runtime_import.cjs Adds github.event_name to the allowlist and provides a concrete runtime value in evalContext.github.
actions/setup/js/runtime_import.test.cjs Updates mock context and adds assertions to validate allowlisting + evaluation of github.event_name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pelikhan pelikhan merged commit e63d414 into main Mar 21, 2026
113 checks passed
@pelikhan pelikhan deleted the copilot/investigate-github-event-name branch March 21, 2026 04:51
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.

3 participants