From 00f41c7c504f3c2e4cd74c8dcbd1cc47c6bef2d2 Mon Sep 17 00:00:00 2001 From: atsuyaw Date: Tue, 22 Oct 2024 23:04:26 +0900 Subject: [PATCH] feat: Attach label to PR auto --- .github/workflows/release.yml | 36 ++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a5f59c9..a90a4715 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,19 +1,37 @@ name: Release -"on": ["create"] +"on": + create: + pull_request: + types: [opened,synchronize] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - GH_TOKEN: ${{ github.token }} jobs: openPR: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - uses: tj-actions/changed-files@v40 + id: updCont + with: + files: + - "content/**" + - "data/**" + - uses: tj-actions/changed-files@v40 + id: updSrc + with: + files: + - ".github/**" + - "./**" + - "layout/**" + - "static/**" - name: Create PR + if: {{ github.event_name != create }} + env: + GH_TOKEN: ${{ github.token }} run: | gh pr create \ --base "main" \ @@ -21,3 +39,15 @@ jobs: --title "Release/${{ github.ref_name }}" \ --body "" \ --draft + - name: Mark as post + if: {{ steps.updCont.outputs.any_changed }} + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr edit --add-label "create post" + - name: Mark as dev + if: {{ steps.updSrc.outputs.any_changed }} + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr edit --add-label "development"