Skip to content

Commit ac98d98

Browse files
docs: Add inputs, workflow example
1 parent 3b4a101 commit ac98d98

1 file changed

Lines changed: 48 additions & 4 deletions

File tree

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,60 @@
11
# Github Topic Syncer
22

3-
Sync Github Topics from a Github Action
3+
Sync Github Topics from a Github Action.
4+
5+
Whatever topics are provided in the action will replace the topics in the Github repository
6+
when the action is executed.
47

58
## Inputs
69

10+
## `topics`
11+
12+
A space-separated list of topics to sync. Topics can only contain lower-case letters,
13+
numbers, and hyphens.
14+
15+
### Examples
16+
17+
```yaml
18+
with:
19+
topics: "web-development python"
20+
```
21+
22+
## `token`
723

8-
## Outputs
24+
A Github personal access token with the `repo` scope. Typically this is stored
25+
in repository secrets to provide to the action:
926

27+
### Examples
28+
29+
```yaml
30+
with:
31+
token: ${{ secrets.gh_token }}
32+
```
1033

1134
## Examples
1235

36+
Here's an example workflow that syncs the topics of a Github repository whenever
37+
the workflow is updated on the `main` branch.
38+
39+
```yaml
40+
name: Sync Github Topics
41+
on:
42+
push:
43+
paths:
44+
- ".github/workflows/sync-topics.yml"
45+
branches:
46+
- main
47+
48+
jobs:
49+
sync-topics:
50+
runs-on: ubuntu-latest
51+
name: Sync Github Topics
52+
steps:
53+
- uses: nickderobertis/github-topic-syncer@alpha
54+
with:
55+
topics: "topic1 topic-2"
56+
token: ${{ secrets.gh_token }}
57+
```
1358

1459
## Development Status
1560

@@ -18,11 +63,10 @@ Any time the major version changes, there may be breaking changes. If it is work
1863
pegging to the current major version, e.g. `github-topic-syncer@v1`, to avoid breaking changes. Alternatively,
1964
you can always point to the most recent stable release with the `github-topic-syncer@latest`.
2065

21-
2266
## Developing
2367

2468
Clone the repo and then run `npm install` to set up the pre-commit hooks.
2569

2670
## Author
2771

28-
Created by Nick DeRobertis. MIT License.
72+
Created by Nick DeRobertis. MIT License.

0 commit comments

Comments
 (0)