Skip to content

Commit

Permalink
Add script to sync labels (microsoft#3323)
Browse files Browse the repository at this point in the history
Add script to sync labels to enforce the labels designed in microsoft#3265
<img width="1050" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/5ba6a134-e6d6-4a28-9cf7-99fd27c8e89e">
  • Loading branch information
timotheeguerin authored May 13, 2024
1 parent f4b0497 commit adc2f32
Show file tree
Hide file tree
Showing 8 changed files with 767 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:

steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set node version to ${{ inputs.node-version }}
uses: actions/setup-node@v4
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Sync labels

on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- "main"
paths:
- "package.json"
- "eng/common/labels.yaml"
- "eng/common/scripts/sync-labels.ts"
- ".github/workflows/sync-labels.yml"

workflow_dispatch: {}

permissions:
issues: write

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- run: pnpm install
name: Install dependencies

- run: pnpm sync-labels --github
name: Sync labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/verify-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Verify labels
on:
pull_request:
branches:
- "main"
paths:
- "package.json"
- "eng/common/labels.yaml"
- "eng/common/scripts/sync-labels.ts"
- ".github/workflows/sync-labels.yml"
- "CONTRIBUTING.md"

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- run: pnpm install
name: Install dependencies

- run: pnpm sync-labels --github --check
name: Verify labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit adc2f32

Please sign in to comment.