From 1e8fc9b517a5fc4a6d386ee8eb26a813a39cc26b Mon Sep 17 00:00:00 2001 From: Jean-Francis Bastien Date: Mon, 20 Jun 2022 20:02:46 -0400 Subject: [PATCH] Default github.token --- README.md | 3 +-- action.yml | 2 +- index.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a97048b..fdf7450 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ Minimal setup. uses: Bhacaz/checkout-files@v1 with: files: package.json - token: ${{ secrets.GITHUB_TOKEN }} ``` ## Inputs @@ -20,5 +19,5 @@ Minimal setup. |Name|Description|Required|Default| |---|---|---|---| |`files`|A list of files with the path separated by a space, relative to root of your repository. Can also be a folder and the action will recursively pull all the files.|`true`|N/A| -|`token`|A GitHub token. Setting `${{ secrets.GITHUB_TOKEN }}` give acces to the one [automatically generated](https://docs.github.com/en/actions/security-guides/automatic-token-authentication). |`true`|N/A| +|`token`|A GitHub token. |`false`|`${{ github.token }}`| |`branch`|Checkout files from a specific branch.|`false`|`master`| diff --git a/action.yml b/action.yml index c37be84..c75524a 100644 --- a/action.yml +++ b/action.yml @@ -12,7 +12,7 @@ inputs: required: true token: description: 'A Github Private Access Token' - required: true + default: ${{ github.token }} branch: description: 'Branch to checkout files from' required: false diff --git a/index.js b/index.js index 6c1da3c..e726a76 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const core = require('@actions/core'); const github = require('@actions/github'); const fs = require('fs'); -const token = core.getInput('token', { required: true }); +const token = core.getInput('token'); const octokit = github.getOctokit(token) const files = core.getInput('files', { required: true }).split(' ');