From 87bfae207900deafa6d0f4013761df37835c433f Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 11 Sep 2019 20:32:10 +0100 Subject: [PATCH 1/2] Update readme to show how to use the secret GITHUB_TOKEN --- packages/github/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/github/README.md b/packages/github/README.md index b4312568d2..a04ce9e164 100644 --- a/packages/github/README.md +++ b/packages/github/README.md @@ -11,6 +11,8 @@ const github = require('@actions/github'); const core = require('@actions/core'); // 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 } const myToken = core.getInput('myToken'); const octokit = new github.GitHub(myToken); From 91809e340da6c8bec411823e9d3644c353bab35a Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 11 Sep 2019 20:36:04 +0100 Subject: [PATCH 2/2] Adds in link to docs - which I feel seem to be scattered in repos & official docs --- packages/github/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/github/README.md b/packages/github/README.md index a04ce9e164..d441949fed 100644 --- a/packages/github/README.md +++ b/packages/github/README.md @@ -13,6 +13,7 @@ const core = require('@actions/core'); // 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/articles/virtual-environments-for-github-actions#github_token-secret const myToken = core.getInput('myToken'); const octokit = new github.GitHub(myToken);