From e7435fa0095760f2be706dd8cdcd81e314f8ec10 Mon Sep 17 00:00:00 2001 From: cenfun Date: Sat, 27 Jul 2024 13:05:35 +0800 Subject: [PATCH] test env --- test/test-pr.js | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/test/test-pr.js b/test/test-pr.js index 82b1c83b..b5addfd3 100644 --- a/test/test-pr.js +++ b/test/test-pr.js @@ -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`);