Skip to content

Commit 23fe0d8

Browse files
authored
chore: Update github secret name to GH_PAT_AUTO_COMMENTS from GH_PAT (#13)
1 parent 07b4743 commit 23fe0d8

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
3939
Thanks for your first contribution, @{{username}}. We're glad you're here.
4040
secrets:
41-
token: ${{ secrets.GH_PAT }}
41+
token: ${{ secrets.GH_PAT_AUTO_COMMENTS }}
4242
```
4343
4444
## 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
8383
8484
After generating the token, you need to add it as a repository secret:
8585
86-
### Adding Repository Secrets
86+
### Adding Repository or Organization Secrets
8787
88+
You can configure this workflow with either a repository-level secret or an organization-level secret:
89+
90+
#### For Repository-Level Secret:
8891
1. Go to your repository
8992
2. Click on "Settings"
9093
3. In the left sidebar, click on "Secrets and variables" → "Actions"
9194
4. Click "New repository secret"
92-
5. Name the secret `GH_PAT` (to match the example-usage.yml)
93-
- **Note**: Secret names must NOT start with `GITHUB_` as this prefix is reserved by GitHub
95+
5. Name the secret `GH_PAT_AUTO_COMMENTS`
9496
6. Paste your token value
9597
7. Click "Add secret"
9698

99+
#### For Organization-Level Secret:
100+
1. Go to your organization's main page
101+
2. Click on "Settings"
102+
3. In the left sidebar, click on "Secrets and variables" → "Actions"
103+
4. Click "New organization secret"
104+
5. Name the secret `GH_PAT_AUTO_COMMENTS`
105+
6. Choose your repository access policy (all repositories or select repositories)
106+
7. Paste your token value
107+
8. Click "Add secret"
108+
109+
Both repository-level and organization-level secrets are accessed the same way in workflows: `${{ secrets.GH_PAT_AUTO_COMMENTS }}`.
110+
97111
### References
98112
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).
99113

example-usage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
additional_internal_users: "external-consultant,bot-account"
1414
# No comment content provided - will use defaults
1515
secrets:
16-
token: ${{ secrets.GH_PAT }}
16+
token: ${{ secrets.GH_PAT_AUTO_COMMENTS }}
1717

1818
# Example 2: Customizing some comments, disabling others
1919
pr-comments-custom:
@@ -38,4 +38,4 @@ jobs:
3838
Thank you @{{username}} for your contribution to {{repository}}!
3939
Your changes are now part of the {{org}} codebase.
4040
secrets:
41-
token: ${{ secrets.GH_PAT }}
41+
token: ${{ secrets.GH_PAT_AUTO_COMMENTS }}

0 commit comments

Comments
 (0)