10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c32ce14 commit bfb7c23Copy full SHA for bfb7c23
README.md
@@ -350,3 +350,32 @@ jobs:
350
351
console.log(`Hello ${FIRST_NAME} ${LAST_NAME}`)
352
```
353
+
354
+### Using a separate GitHub token
355
356
+The `GITHUB_TOKEN` used by default is scoped to the current repository, see [Authentication in a workflow](https://docs.github.com/actions/reference/authentication-in-a-workflow).
357
358
+If you need access to a different repository or an API that the `GITHUB_TOKEN` doesn't have permissions to, you can provide your own [PAT](https://help.github.com/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) as a secret using the `github-token` input.
359
360
+[Learn more about creating and using encrypted secrets](https://docs.github.com/actions/reference/encrypted-secrets)
361
362
+```yaml
363
+on:
364
+ issues:
365
+ types: [opened]
366
367
+jobs:
368
+ apply-label:
369
+ runs-on: ubuntu-latest
370
+ steps:
371
+ - uses: actions/github-script@v4
372
+ with:
373
+ github-token: ${{ secrets.MY_PAT }}
374
+ script: |
375
+ github.issues.addLabels({
376
+ issue_number: context.issue.number,
377
+ owner: context.repo.owner,
378
+< 432C /span> repo: context.repo.repo,
379
+ labels: ['Triage']
380
+ })
381
+```