Fix integration codeowner workflow failing on github-script v9 - #1499
Merged
Merged
Conversation
Remove redundant @actions/core requires from github-script v9 steps to prevent 'Identifier 'core' has already been declared' failures on pull_request_target and issue_comment triggers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1499Or
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1499" |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the integration-codeowner GitHub Actions workflow failing under actions/github-script@v9 by removing redundant @actions/core re-declarations that conflict with the pre-provided core object in the github-script runtime context.
Changes:
- Removed
const core = require('@actions/core');from the workflow’s github-script steps. - Preserved existing
core.setOutput(...)usage so downstream step outputs remain unchanged.
Odonno
approved these changes
Aug 1, 2026
Contributor
|
afscrome
temporarily deployed
to
azure-artifacts
August 1, 2026 19:53 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
require('@actions/core')declarations from.github/workflows/integration-codeowner.ymlcore.setOutput(...)usage unchangedSyntaxError: Identifier 'core' has already been declaredinactions/github-script@v9stepsWhy this PR still shows a failing check
Integration code owner automationis triggered bypull_request_target.For
pull_request_targetevents, GitHub evaluates workflow files from the base branch (main), not from the PR head branch. That means PR #1499 still executes the currently broken workflow definition onmain, soprompt-for-codeownercontinues to fail on this PR even though the fix is present in the PR branch.After this PR merges, the fixed workflow will exist on
main, and subsequentpull_request_targetruns will use the corrected version.Root cause
The workflow was introduced with
actions/github-script@v9scripts that redeclaredcore:In
github-script@v9,coreis already provided in the script context, so redeclaration throws and hard-fails the job.