From 9e6fb06825e873191b4d7dbdf5e5e068ea8a8e28 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Sat, 22 Mar 2025 12:32:57 -0400 Subject: [PATCH] chore: Update github secret name to GH_PAT_AUTO_COMMENTS from GH_PAT --- README.md | 22 ++++++++++++++++++---- example-usage.yml | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 843865e..62c76f2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ jobs: Thanks for your first contribution, @{{username}}. We're glad you're here. secrets: - token: ${{ secrets.GH_PAT }} + token: ${{ secrets.GH_PAT_AUTO_COMMENTS }} ``` ## How to Create a Personal Access Token (PAT) @@ -83,17 +83,31 @@ When creating a fine-grained personal access token, you'll need to configure the After generating the token, you need to add it as a repository secret: -### Adding Repository Secrets +### Adding Repository or Organization Secrets +You can configure this workflow with either a repository-level secret or an organization-level secret: + +#### For Repository-Level Secret: 1. Go to your repository 2. Click on "Settings" 3. In the left sidebar, click on "Secrets and variables" → "Actions" 4. Click "New repository secret" -5. Name the secret `GH_PAT` (to match the example-usage.yml) - - **Note**: Secret names must NOT start with `GITHUB_` as this prefix is reserved by GitHub +5. Name the secret `GH_PAT_AUTO_COMMENTS` 6. Paste your token value 7. Click "Add secret" +#### For Organization-Level Secret: +1. Go to your organization's main page +2. Click on "Settings" +3. In the left sidebar, click on "Secrets and variables" → "Actions" +4. Click "New organization secret" +5. Name the secret `GH_PAT_AUTO_COMMENTS` +6. Choose your repository access policy (all repositories or select repositories) +7. Paste your token value +8. Click "Add secret" + +Both repository-level and organization-level secrets are accessed the same way in workflows: `${{ secrets.GH_PAT_AUTO_COMMENTS }}`. + ### References For more detailed information about GitHub tokens and permissions, refer to the [GitHub documentation on fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token). diff --git a/example-usage.yml b/example-usage.yml index 39f0f8f..1f55bf5 100644 --- a/example-usage.yml +++ b/example-usage.yml @@ -13,7 +13,7 @@ jobs: additional_internal_users: "external-consultant,bot-account" # No comment content provided - will use defaults secrets: - token: ${{ secrets.GH_PAT }} + token: ${{ secrets.GH_PAT_AUTO_COMMENTS }} # Example 2: Customizing some comments, disabling others pr-comments-custom: @@ -38,4 +38,4 @@ jobs: Thank you @{{username}} for your contribution to {{repository}}! Your changes are now part of the {{org}} codebase. secrets: - token: ${{ secrets.GH_PAT }} + token: ${{ secrets.GH_PAT_AUTO_COMMENTS }}