Skip to content

chore: Update github secret name to GH_PAT_AUTO_COMMENTS from GH_PAT #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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).

Expand Down
4 changes: 2 additions & 2 deletions example-usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}