Skip to content

Commit 05c2ecb

Browse files
committed
add readme section for skipping internal contributors
1 parent c6306b0 commit 05c2ecb

1 file changed

Lines changed: 41 additions & 22 deletions

File tree

README.md

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
Automatically welcome first-time contributors on issues and pull requests.
1414

15-
## Quick Start
15+
## Quick start
1616

1717
Create `.github/workflows/welcome.yml` and paste:
1818

@@ -61,24 +61,24 @@ That's all you need.
6161
6262
### Inputs
6363
64-
| Input | Description |
65-
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
66-
| `token` | GitHub token for API access. [Default: github.token] |
67-
| `issue-opened-msg` | Message for a first-time issue |
68-
| `pr-opened-msg` | Message for a first-time PR |
69-
| `issue-completed-msg` | Message when a first-time issue is closed as completed |
70-
| `issue-not-planned-msg` | Message when a first-time issue is closed as not planned |
71-
| `pr-merged-msg` | Message when a first-time PR is merged |
72-
| `pr-closed-msg` | Message when a first-time PR is closed (not merged) |
73-
| `labels` | Labels to add (comma separated) |
74-
| `issue-labels` | Labels for issues (overrides labels) |
75-
| `pr-labels` | Labels for PRs (overrides labels) |
76-
| `reactions` | Reactions to add (comma separated) |
77-
| `issue-reactions` | Reactions for issues (overrides reactions) |
78-
| `pr-reactions` | Reactions for PRs (overrides reactions) |
79-
| `contribution-mode` | `once` to greet only on a user’s absolute first interaction. [Default: greet on first issue and first PR] |
80-
| `fail-on-error` | Fail the workflow if an error occurs. [Default: false] |
81-
| `skip-internal-contributors` | Skip org members and repository collaborators. Needs `GH_PAT_READ_ORG` env variable. See [Advanced](#advanced-configuration) |
64+
| Input | Description |
65+
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
66+
| `token` | GitHub token for API access. [Default: github.token] |
67+
| `issue-opened-msg` | Message for a first-time issue |
68+
| `pr-opened-msg` | Message for a first-time PR |
69+
| `issue-completed-msg` | Message when a first-time issue is closed as completed |
70+
| `issue-not-planned-msg` | Message when a first-time issue is closed as not planned |
71+
| `pr-merged-msg` | Message when a first-time PR is merged |
72+
| `pr-closed-msg` | Message when a first-time PR is closed (not merged) |
73+
| `labels` | Labels to add (comma separated) |
74+
| `issue-labels` | Labels for issues (overrides labels) |
75+
| `pr-labels` | Labels for PRs (overrides labels) |
76+
| `reactions` | Reactions to add (comma separated) |
77+
| `issue-reactions` | Reactions for issues (overrides reactions) |
78+
| `pr-reactions` | Reactions for PRs (overrides reactions) |
79+
| `contribution-mode` | `once` to greet only on a user’s absolute first interaction. [Default: greet on first issue and first PR] |
80+
| `fail-on-error` | Fail the workflow if an error occurs. [Default: false] |
81+
| `skip-internal-contributors` | Skip org members and repository collaborators. Needs `GH_PAT_READ_ORG` env variable. See [Skip internal contributors](#skip-internal-contributors) |
8282

8383
> [!NOTE]
8484
>
@@ -104,7 +104,7 @@ That's all you need.
104104
pr-reactions: +1, rocket
105105
```
106106

107-
### Greet Only Once
107+
### Greet only once
108108

109109
```yaml
110110
- uses: plbstl/first-contribution@4fb1541ce2706255850d56c5684552607be1ae9b # v4.2.0
@@ -115,7 +115,7 @@ That's all you need.
115115
pr-opened-msg: issue-opened-msg
116116
```
117117

118-
### After Merge (all-contributors)
118+
### After merge (all-contributors)
119119

120120
```yaml
121121
name: Add new contributor
@@ -137,7 +137,7 @@ jobs:
137137
@all-contributors please add @{fc-author} for ${{ join(github.event.pull_request.labels.*.name, ', ') }}
138138
```
139139

140-
### Advanced Configuration
140+
### Advanced configuration
141141

142142
```yaml
143143
name: First contribution flow
@@ -184,6 +184,25 @@ jobs:
184184
>
185185
> Action logs can help for troubleshooting
186186

187+
## Skip internal contributors
188+
189+
Internal contributors are organization members and repository collaborators.
190+
191+
To enable this behavior, set `skip-internal-contributors` to true, and populate the `GH_PAT_READ_ORG` env variable.
192+
193+
```yml
194+
steps:
195+
- uses: plbstl/first-contribution@commit-sha
196+
env:
197+
GH_PAT_READ_ORG: ${{ secrets.GH_PAT_READ_ORG }}
198+
with:
199+
skip-internal-contributors: true
200+
# other options...
201+
```
202+
203+
Create a Personal Access Token (PAT) with <https://github.com/settings/tokens/new?scopes=read:org>. Only `read:org`
204+
scope is needed.
205+
187206
## Security
188207

189208
This action uses `pull_request_target` so it can comment on PRs from forks.

0 commit comments

Comments
 (0)