Skip to content

Commit

Permalink
Merge branch 'alpha' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nickderobertis committed Jun 25, 2022
2 parents 0fb5b72 + ba708bc commit acedb1c
Show file tree
Hide file tree
Showing 13 changed files with 10,334 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ jobs:
uses: actions/checkout@v3
- name: Test Action
uses: ./ # Uses an action in the root directory
with:
topics: "github-actions github-topics sync"
token: ${{ secrets.gh_token }}
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run build
git add dist
56 changes: 50 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,72 @@
# Github Topic Syncer

Sync Github Topics from a Github Action
Sync Github Topics from a Github Action.

Whatever topics are provided in the action will replace the topics in the Github repository
when the action is executed.

## Inputs

### `topics`

A space-separated list of topics to sync. Topics can only contain lower-case letters,
numbers, and hyphens.

#### Examples

```yaml
with:
topics: "web-development python"
```
### `token`

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

#### Examples

```yaml
with:
token: ${{ secrets.gh_token }}
```

## Examples

Here's an example workflow that syncs the topics of a Github repository whenever
the workflow is updated on the `main` branch.

```yaml
name: Sync Github Topics
on:
push:
paths:
- ".github/workflows/sync-topics.yml"
branches:
- main
jobs:
sync-topics:
runs-on: ubuntu-latest
name: Sync Github Topics
steps:
- uses: nickderobertis/github-topic-syncer@alpha
with:
topics: "topic1 topic-2"
token: ${{ secrets.gh_token }}
```

## Development Status

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

pegging to the current major version, e.g. `nickderobertis/github-topic-syncer@v1`, to avoid breaking changes. Alternatively,
you can always point to the most recent stable release with the `nickderobertis/github-topic-syncer@latest`.

## Developing

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

## Author

Created by Nick DeRobertis. MIT License.
Created by Nick DeRobertis. MIT License.
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ description: 'Sync Github Topics from a Github Action'
runs:
using: node16
main: "dist/index.js"

inputs:
topics:
description: 'Space-separated topics to sync to Github'
required: true
token:
description: 'Github token'
required: true

Loading

0 comments on commit acedb1c

Please sign in to comment.