Skip to content

Commit

Permalink
test env
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jul 27, 2024
1 parent a476fa9 commit e7435fa
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions test/test-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@ const getPullRequestChanges = async () => {
return [];
}

console.log('pull_request', github.context.payload.pull_request);
// console.log('pull_request', github.context.payload.pull_request);

// This should be a token with access to your repository scoped in as a secret.
// The YML workflow will need to set myToken with the GitHub Secret Token
// myToken: ${{ secrets.GITHUB_TOKEN }}
// https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret
const GITHUB_TOKEN = core.getInput('GITHUB_TOKEN');
console.log('GITHUB_TOKEN', GITHUB_TOKEN, process.env.GITHUB_TOKEN);

const token = core.getInput('token');
console.log('token', token, process.env.token);

const octokit = github.getOctokit(GITHUB_TOKEN || token);

// // You can also pass in additional options as a second parameter to getOctokit
// // const octokit = github.getOctokit(myToken, {userAgent: "MyActionVersion1"});
/**
* env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
*/

const octokit = github.getOctokit(process.env.GITHUB_TOKEN);
const prNumber = github.context.payload.pull_request.number;
core.startGroup(`Fetching list of changed files for PR#${prNumber} from Github API`);

Expand Down

0 comments on commit e7435fa

Please sign in to comment.