Skip to content

Commit d198274

Browse files
committed
Update README
1 parent c5a4d38 commit d198274

File tree

1 file changed

+75
-2
lines changed

1 file changed

+75
-2
lines changed

README.md

+75-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,75 @@
1-
# find-comment
2-
A GitHub action to find an issue or pull request comment
1+
# Find Comment
2+
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Find%20Comment-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/find-comment)
3+
4+
A GitHub action to find an issue or pull request comment.
5+
6+
The action will output the comment ID of the first comment matching the search criteria.
7+
8+
## Usage
9+
10+
### Find a comment containing the specified string
11+
12+
```yml
13+
- name: Find Comment
14+
uses: peter-evans/find-comment@v1
15+
id: fc
16+
with:
17+
issue-number: 1
18+
body-includes: search string 1
19+
```
20+
21+
### Find a comment by the specified author
22+
23+
```yml
24+
- name: Find Comment
25+
uses: peter-evans/find-comment@v1
26+
id: fc
27+
with:
28+
issue-number: 1
29+
comment-author: peter-evans
30+
```
31+
32+
### Find a comment containing the specified string AND by the specified author
33+
34+
```yml
35+
- name: Find Comment
36+
uses: peter-evans/find-comment@v1
37+
id: fc
38+
with:
39+
issue-number: 1
40+
comment-author: peter-evans
41+
body-includes: search string 1
42+
```
43+
44+
### Action inputs
45+
46+
| Name | Description | Default |
47+
| --- | --- | --- |
48+
| `token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). | `GITHUB_TOKEN` |
49+
| `repository` | The full name of the repository containing the issue or pull request. | Current repository |
50+
| `issue-number` | The number of the issue or pull request in which to search. | |
51+
| `comment-author` | The GitHub user name of the comment author. | |
52+
| `body-includes` | A string to search for in the body of comments. | |
53+
54+
#### Outputs
55+
56+
The ID of the first matching comment found will be output for use in later steps.
57+
Note that in order to read the step output the action step must have an id.
58+
59+
```yml
60+
- name: Find Comment
61+
uses: peter-evans/find-comment@v1
62+
id: fc
63+
with:
64+
issue-number: 1
65+
body-includes: search string 1
66+
- run: echo ${{ steps.fc.outputs.comment-id }}
67+
```
68+
69+
### Accessing issues and pull requests in other repositories
70+
71+
You can search the comments of issues and pull requests in another repository by using a [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) instead of `GITHUB_TOKEN`.
72+
73+
## License
74+
75+
[MIT](LICENSE)

0 commit comments

Comments
 (0)