File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @changesets/action " : major
3+ ---
4+
5+ Remove support for passing custom GitHub token through the GITHUB_TOKEN environment variable. It should be passed to the ` github-token ` input instead.
Original file line number Diff line number Diff line change @@ -3,16 +3,16 @@ import * as core from "@actions/core";
33import { GitHub } from "./github.ts" ;
44import readChangesetState from "./readChangesetState.ts" ;
55import { runPublish , runVersion } from "./run.ts" ;
6- import { fileExists , getOptionalInput } from "./utils.ts" ;
6+ import { fileExists , getOptionalInput , getRequiredInput } from "./utils.ts" ;
77
88( async ( ) => {
9- // to maintain compatibility with workflows created before github-token input was introduced
10- // it's important to prefer the explicitly set GITHUB_TOKEN over the default token coming from github.token
11- let githubToken = process . env . GITHUB_TOKEN || core . getInput ( "github-token" ) ;
12-
13- if ( ! githubToken ) {
14- core . setFailed ( "Please add the GITHUB_TOKEN to the changesets action" ) ;
15- return ;
9+ const githubToken = getRequiredInput ( " github-token" ) ;
10+ if ( process . env . GITHUB_TOKEN && process . env . GITHUB_TOKEN !== githubToken ) {
11+ throw new Error (
12+ 'The GITHUB_TOKEN environment variable is set and does not match the "github-token" input. ' +
13+ 'Please pass the custom GitHub token to the "github-token" input and ' +
14+ "remove the GITHUB_TOKEN environment variable to avoid conflicts." ,
15+ ) ;
1616 }
1717
1818 // If the user needs to change the cwd, set `working-directory` in the step instead
You can’t perform that action at this time.
0 commit comments