diff --git a/.github/workflows/release-new-action-version.yml b/.github/workflows/release-new-action-version.yml index a187d1ab..b95570f8 100644 --- a/.github/workflows/release-new-action-version.yml +++ b/.github/workflows/release-new-action-version.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Update the ${{ env.TAG_NAME }} tag - uses: actions/publish-action@v0.2.1 + uses: actions/publish-action@v0.2.2 with: source-tag: ${{ env.TAG_NAME }} slack-webhook: ${{ secrets.SLACK_WEBHOOK }} diff --git a/README.md b/README.md index 4c1a687f..b869a7e3 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,6 @@ # Pull Request Labeler -
+[](https://github.com/actions/labeler/actions/workflows/basic-validation.yml) Automatically label new pull requests based on the paths of files being changed or the branch name. @@ -133,21 +126,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" ``` -_Note: This grants access to the `GITHUB_TOKEN` so the action can make calls to GitHub's rest API_ - #### Inputs Various inputs are defined in [`action.yml`](action.yml) to let you configure the labeler: | Name | Description | Default | | - | - | - | -| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret, with `contents:read` and `pull-requests:write` access | N/A | +| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret, with `contents:read` and `pull-requests:write` access | `github.token` | | `configuration-path` | The path to the label configuration file | `.github/labeler.yml` | -| `sync-labels` | Whether or not to remove labels when matching files are reverted or no longer changed by the PR | `false` +| `sync-labels` | Whether or not to remove labels when matching files are reverted or no longer changed by the PR | `false`| # Contributions diff --git a/action.yml b/action.yml index 42e8a7a2..a3df342b 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,9 @@ description: 'Automatically label new pull requests based on the paths of files author: 'GitHub' inputs: repo-token: - description: 'The GITHUB_TOKEN secret' + description: 'The GitHub token used to manage labels' + required: false + default: ${{ github.token }} configuration-path: description: 'The path for the label configurations' default: '.github/labeler.yml' diff --git a/dist/index.js b/dist/index.js index ef8dc9a1..b6f4f937 100644 --- a/dist/index.js +++ b/dist/index.js @@ -148,7 +148,7 @@ const branch_1 = __nccwpck_require__(8045); function run() { return __awaiter(this, void 0, void 0, function* () { try { - const token = core.getInput('repo-token', { required: true }); + const token = core.getInput('repo-token'); const configPath = core.getInput('configuration-path', { required: true }); const syncLabels = !!core.getInput('sync-labels', { required: false }); const prNumber = getPrNumber(); diff --git a/package-lock.json b/package-lock.json index 97ce9bbc..ee387af6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,11 +19,11 @@ "@types/js-yaml": "^4.0.5", "@types/minimatch": "^5.1.2", "@types/node": "^16.11.7", - "@vercel/ncc": "^0.36.0", + "@vercel/ncc": "^0.36.1", "jest": "^27.5.1", - "prettier": "^2.8.1", + "prettier": "^2.8.4", "ts-jest": "^27.1.3", - "typescript": "^4.9.4" + "typescript": "^4.9.5" } }, "node_modules/@actions/core": { @@ -1210,9 +1210,9 @@ "dev": true }, "node_modules/@vercel/ncc": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.0.tgz", - "integrity": "sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A==", + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", + "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==", "dev": true, "bin": { "ncc": "dist/ncc/cli.js" @@ -3606,9 +3606,9 @@ } }, "node_modules/prettier": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.2.tgz", - "integrity": "sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -4220,9 +4220,9 @@ } }, "node_modules/typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -5489,9 +5489,9 @@ "dev": true }, "@vercel/ncc": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.0.tgz", - "integrity": "sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A==", + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", + "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==", "dev": true }, "abab": { @@ -7308,9 +7308,9 @@ "dev": true }, "prettier": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.2.tgz", - "integrity": "sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "dev": true }, "pretty-format": { @@ -7751,9 +7751,9 @@ } }, "typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, "universal-user-agent": { diff --git a/package.json b/package.json index f8f7abf1..03e17cce 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,10 @@ "@types/node": "^16.11.7", "@types/minimatch": "^5.1.2", "@types/js-yaml": "^4.0.5", - "@vercel/ncc": "^0.36.0", + "@vercel/ncc": "^0.36.1", "jest": "^27.5.1", - "prettier": "^2.8.1", + "prettier": "^2.8.4", "ts-jest": "^27.1.3", - "typescript": "^4.9.4" + "typescript": "^4.9.5" } } diff --git a/src/labeler.ts b/src/labeler.ts index 9d20e65d..510b967f 100644 --- a/src/labeler.ts +++ b/src/labeler.ts @@ -18,7 +18,7 @@ type ClientType = ReturnType