Skip to content

Commit acedb1c

Browse files
Merge branch 'alpha' into main
2 parents 0fb5b72 + ba708bc commit acedb1c

13 files changed

Lines changed: 10334 additions & 11 deletions

File tree

.github/workflows/test-action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ jobs:
1212
uses: actions/checkout@v3
1313
- name: Test Action
1414
uses: ./ # Uses an action in the root directory
15+
with:
16+
topics: "github-actions github-topics sync"
17+
token: ${{ secrets.gh_token }}

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run build
5+
git add dist

README.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,72 @@
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

1661
This project uses [semantic-release](https://github.com/semantic-release/semantic-release) for versioning.
1762
Any time the major version changes, there may be breaking changes. If it is working well for you, consider
18-
pegging to the current major version, e.g. `github-topic-syncer@v1`, to avoid breaking changes. Alternatively,
19-
you can always point to the most recent stable release with the `github-topic-syncer@latest`.
20-
63+
pegging to the current major version, e.g. `nickderobertis/github-topic-syncer@v1`, to avoid breaking changes. Alternatively,
64+
you can always point to the most recent stable release with the `nickderobertis/github-topic-syncer@latest`.
2165

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.

action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@ description: 'Sync Github Topics from a Github Action'
33
runs:
44
using: node16
55
main: "dist/index.js"
6-
6+
inputs:
7+
topics:
8+
description: 'Space-separated topics to sync to Github'
9+
required: true
10+
token:
11+
description: 'Github token'
12+
required: true
13+

0 commit comments

Comments
 (0)