Skip to content

Commit

Permalink
feat: sync labels
Browse files Browse the repository at this point in the history
  • Loading branch information
9renpoto committed Dec 31, 2023
1 parent d60ed28 commit af33365
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/export-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Export label

on:
label:
types: [created, edited, deleted]
workflow_dispatch:

permissions:
issues: read
contents: write
pull-requests: write

jobs:
export_labels:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: EndBug/export-label-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

create_pull_request:
runs-on: ubuntu-latest
timeout-minutes: 5
needs:
- export_labels
steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: actions/download-artifact@v3
with:
name: Label config
- run: cp labels.yaml .github/labels.yaml
- uses: peter-evans/create-pull-request@v5
with:
commit-message: Update labels
delete-branch: true
title: Update labels
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
branch: create-pull-request/patch-export-label
add-paths: |
.github/labels.yaml
25 changes: 25 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Sync labels

on:
push:
branches:
- main
paths:
- ".github/labels.yaml"
workflow_dispatch:

permissions:
issues: write
contents: read

jobs:
label_sync:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v3
- uses: EndBug/label-sync@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: .github/labels.yaml
delete-other-labels: true

0 comments on commit af33365

Please sign in to comment.