Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

40 changes: 0 additions & 40 deletions .eslintrc

This file was deleted.

15 changes: 10 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
node-version: 22.x
- run: npm install
- run: npm run lint
run_install: false
version: 11
- uses: actions/setup-node@v6
with:
node-version: 24.x
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,47 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v6
with:
run_install: false
version: 11

- name: Set up Node.js for NPM
uses: actions/setup-node@v6
with:
node-version: 22.x
node-version: 24.x
registry-url: https://registry.npmjs.org
package-manager-cache: false

- run: npm ci
- run: npm publish
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm publish --no-git-checks

publish-gpr:
name: Publish on GPR
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v6
with:
run_install: false
version: 11

- name: Set up Node.js for GPR
uses: actions/setup-node@v6
with:
node-version: 22.x
node-version: 24.x
registry-url: https://npm.pkg.github.com/
scope: '@endbug'
package-manager-cache: false
scope: '@endbug'

- run: npm ci
- run: pnpm install --frozen-lockfile
- run: pnpm build

- run: npm publish
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 10 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
node-version: 22.x
- run: npm install
- run: npm run test-coverage
run_install: false
version: 11
- uses: actions/setup-node@v6
with:
node-version: 24.x
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
coverage
dist
node_modules
npm-debug.log
pnpm-debug.log
*.tsbuildinfo
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You'll need [Node.js][node] 20+ installed to run GitHub Label Sync. You'll also
Install GitHub Label Sync globally with [npm][npm]:

```sh
npm install -g @endbug/github-label-sync
pnpm add -g @endbug/github-label-sync
```

This installs the `github-label-sync` command-line tool:
Expand All @@ -39,6 +39,7 @@ Options:
-l, --labels <path> the path or URL to look for the label configuration in. Default: labels.json
-d, --dry-run calculate the required label changes but do not apply them
-A, --allow-added-labels allow additional labels in the repo, and don't delete them
-e, --endpoint <url> specify a GitHub enterprise installation
```

Run GitHub Label Sync on a repo (reading [label data](#label-config-file) from a local `labels.json`):
Expand Down Expand Up @@ -76,13 +77,19 @@ github-label-sync --access-token xxxxxx --allow-added-labels myname/myrepo
Install GitHub Label Sync with [npm][npm] or add to your `package.json`:

```
npm install @endbug/github-label-sync
pnpm add @endbug/github-label-sync
```

Require GitHub Label Sync:
Require GitHub Label Sync (CommonJS):

```js
var githubLabelSync = require('@endbug/github-label-sync');
const githubLabelSync = require('@endbug/github-label-sync');
```

Or with ESM/TypeScript:

```ts
import githubLabelSync from '@endbug/github-label-sync';
```

The `githubLabelSync` function returns a promise that resolves to a JSON diff between the labels found on GitHub, and the labels in your label config.
Expand Down Expand Up @@ -191,7 +198,7 @@ For example, given the following config, GitHub Label Sync will look for labels
}
```

You can find a full example label configuration in this repository ([JSON](labels.json) / [YAML](labels.yml)).
You can find a full example label configuration in this repository ([YAML](labels.yml)).

## Configuration

Expand Down Expand Up @@ -279,10 +286,10 @@ To contribute to GitHub Label Sync, clone this repo locally and commit your code
Please write unit tests for your code, and check that everything works by running the following before opening a pull-request:

```sh
npm test # run the full test suite
npm run lint # run the linter
npm run test-unit # run the unit tests
npm run test-coverage # run the unit tests with coverage reporting
pnpm test # run the full test suite
pnpm lint # run the linter
pnpm test:unit # run the unit tests
pnpm test:coverage # run the unit tests with coverage reporting
```

## License
Expand Down
180 changes: 0 additions & 180 deletions bin/github-label-sync.js

This file was deleted.

Loading