From af333659f10f1ab65748c9ed117e2aed9f9dddf0 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 31 Dec 2023 12:28:01 +0900 Subject: [PATCH] feat: sync labels --- .github/workflows/export-labels.yml | 43 +++++++++++++++++++++++++++++ .github/workflows/sync-labels.yml | 25 +++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/export-labels.yml create mode 100644 .github/workflows/sync-labels.yml diff --git a/.github/workflows/export-labels.yml b/.github/workflows/export-labels.yml new file mode 100644 index 0000000..da644c0 --- /dev/null +++ b/.github/workflows/export-labels.yml @@ -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 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 0000000..7699439 --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -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