From e7192dec1270041929c65c38951c2453e38aa31c Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 11:01:15 +0900 Subject: [PATCH 01/19] delelete: draft --- .github/workflows/draft.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/draft.yml diff --git a/.github/workflows/draft.yml b/.github/workflows/draft.yml deleted file mode 100644 index f5d7ee65..00000000 --- a/.github/workflows/draft.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Draft Release - -on: - pull_request: - branches: - - main - types: - - closed - -jobs: - update: - if: github.event.pull_request.merged == true && !contains(github.head_ref, 'release/') - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Update Draft Release - uses: release-drafter/release-drafter@v6 - with: - config-name: release-drafter.yml - disable-autolabeler: true - publish: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e68077bbaed1046c6826851819f4180b9caa8220 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 14:25:18 +0900 Subject: [PATCH 02/19] fix: deploy flow --- .github/environments.json | 18 ++++++++ .github/protection.json | 15 +++++++ .github/workflows/publish-app.yml | 2 +- .github/workflows/publish-devcontainer.yml | 2 +- .github/workflows/release.yml | 29 ++++++++++-- .github/workflows/setting.yml | 52 ++++++++++++++++++++-- 6 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 .github/environments.json diff --git a/.github/environments.json b/.github/environments.json new file mode 100644 index 00000000..79446c9f --- /dev/null +++ b/.github/environments.json @@ -0,0 +1,18 @@ +{ + "Develop": { + "deployment_branch_policy": { + "protected_branches": false, + "custom_branch_policies": true + }, + "reviewers": [], + "wait_timer": 0 + }, + "Production": { + "deployment_branch_policy": { + "protected_branches": false, + "custom_branch_policies": true + }, + "reviewers": [], + "wait_timer": 0 + } +} diff --git a/.github/protection.json b/.github/protection.json index ba49d1ca..509f0774 100644 --- a/.github/protection.json +++ b/.github/protection.json @@ -14,6 +14,21 @@ }, "restrictions": null }, + "develop": { + "allow_deletions": false, + "allow_force_pushes": false, + "enforce_admins": false, + "required_pull_request_reviews": { + "dismiss_stale_reviews": false, + "require_code_owner_reviews": false, + "required_approving_review_count": 1 + }, + "required_status_checks": { + "contexts": [], + "strict": true + }, + "restrictions": null + }, "gh-pages": { "allow_deletions": false, "allow_force_pushes": true, diff --git a/.github/workflows/publish-app.yml b/.github/workflows/publish-app.yml index 97eb7be2..50dd929d 100644 --- a/.github/workflows/publish-app.yml +++ b/.github/workflows/publish-app.yml @@ -3,7 +3,7 @@ name: Publish App to GHCR on: push: branches: - - main + - develop paths: - ".github/workflows/publish-app.yml" - ".python-version" diff --git a/.github/workflows/publish-devcontainer.yml b/.github/workflows/publish-devcontainer.yml index 2715e24d..7b2a950e 100644 --- a/.github/workflows/publish-devcontainer.yml +++ b/.github/workflows/publish-devcontainer.yml @@ -3,7 +3,7 @@ name: Publish Devcontainer to GHCR on: push: branches: - - main + - develop paths: - ".devcontainer/Dockerfile" - ".github/workflows/publish-devcontainer.yml" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f849302e..e2ff5737 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,20 +3,41 @@ name: Release on: pull_request: branches: + - develop - main - types: - - closed permissions: contents: write pull-requests: read jobs: - publish: - if: github.event.pull_request.merged == true && contains(github.head_ref, 'release/') + develop: + if: github.event.pull_request.merged == true && github.base_ref == 'develop' runs-on: ubuntu-latest + environment: Develop + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Update Draft Release + uses: release-drafter/release-drafter@v6 + with: + config-name: release-drafter.yml + disable-autolabeler: true + publish: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + production: + if: github.event.pull_request.merged == true && github.base_ref == 'main' + + runs-on: ubuntu-latest + + environment: Production + steps: - name: Checkout uses: actions/checkout@v6 diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index df488bbf..04615b36 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -23,7 +23,9 @@ jobs: - name: Enable auto-delete head branches run: | - gh repo edit ${{ github.repository }} --delete-branch-on-merge + gh repo edit ${{ github.repository }} \ + --delete-branch-on-merge \ + --default-branch develop env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} @@ -68,12 +70,12 @@ jobs: - name: Apply Branch Protection Rules run: | - if [ ! -f "$CONFIG_FILE" ]; then - echo "Error: $CONFIG_FILE not found!" + if [ ! -f "${{ env.CONFIG_FILE }}" ]; then + echo "Error: ${{ env.CONFIG_FILE }} not found!" exit 1 fi - BRANCHES=$(jq -r 'keys[]' "$CONFIG_FILE") + BRANCHES=$(jq -r 'keys[]' "${{ env.CONFIG_FILE }}") for BRANCH in $BRANCHES; do if ! gh api "repos/${{ github.repository }}/branches/$BRANCH" --silent >/dev/null 2>&1; then @@ -86,3 +88,45 @@ jobs: env: CONFIG_FILE: .github/protection.json GH_TOKEN: ${{ steps.generate-token.outputs.token }} + + environments: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - environment: Develop + branch: develop + - environment: Production + branch: main + + environment: ${{ matrix.environment }} + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.APP_KEY }} + + - name: Configure Environment + run: | + if [ ! -f "${{ env.CONFIG_FILE }}" ]; then + echo "Error: ${{ env.CONFIG_FILE }} not found!" + exit 1 + fi + + jq -c ".\"${{ env.ENVIRONMENT_NAME }}\"" "${{ env.CONFIG_FILE }}" | gh api -X PUT "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}" --input - + + gh api -X PUT "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" \ + -f "name=${{ env.ENVIRONMENT_NAME }}" \ + -f "type=branch" + env: + CONFIG_FILE: .github/environments.json + BRANCH_NAME: ${{ matrix.branch }} + ENVIRONMENT_NAME: ${{ matrix.environment }} + GH_TOKEN: ${{ steps.generate-token.outputs.token }} From a1ab857c8897f44c05b2431b267c2f39729d648a Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 14:44:34 +0900 Subject: [PATCH 03/19] fix: name --- .github/workflows/setting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index 04615b36..d222b837 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -123,7 +123,7 @@ jobs: jq -c ".\"${{ env.ENVIRONMENT_NAME }}\"" "${{ env.CONFIG_FILE }}" | gh api -X PUT "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}" --input - gh api -X PUT "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" \ - -f "name=${{ env.ENVIRONMENT_NAME }}" \ + -f "name=${{ env.BRANCH_NAME }}" \ -f "type=branch" env: CONFIG_FILE: .github/environments.json From b10432e904a8b7476499caca184dc3e388ce7669 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 15:03:21 +0900 Subject: [PATCH 04/19] fix: GitHub Pages --- .github/environments.json | 8 ++++++++ .github/workflows/setting.yml | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/environments.json b/.github/environments.json index 79446c9f..42fbd3c4 100644 --- a/.github/environments.json +++ b/.github/environments.json @@ -14,5 +14,13 @@ }, "reviewers": [], "wait_timer": 0 + }, + "GitHub Pages": { + "deployment_branch_policy": { + "protected_branches": false, + "custom_branch_policies": true + }, + "reviewers": [], + "wait_timer": 0 } } diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index d222b837..8a7cab13 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -99,8 +99,8 @@ jobs: branch: develop - environment: Production branch: main - - environment: ${{ matrix.environment }} + - environment: GitHub Pages + branch: gh-pages steps: - name: Checkout @@ -122,7 +122,7 @@ jobs: jq -c ".\"${{ env.ENVIRONMENT_NAME }}\"" "${{ env.CONFIG_FILE }}" | gh api -X PUT "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}" --input - - gh api -X PUT "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" \ + gh api -X POST "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" \ -f "name=${{ env.BRANCH_NAME }}" \ -f "type=branch" env: From 545d8ea7a60db956f561c9c30950df6e84d8dff1 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 15:13:42 +0900 Subject: [PATCH 05/19] add: types --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2ff5737..78e7ebe4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,8 @@ on: branches: - develop - main + types: + - closed permissions: contents: write From 478eeea54a4fc54366bc3051b75c8a6f87ae2fb9 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 15:17:01 +0900 Subject: [PATCH 06/19] chore --- .github/workflows/setting.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index 8a7cab13..65775b8f 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -24,8 +24,8 @@ jobs: - name: Enable auto-delete head branches run: | gh repo edit ${{ github.repository }} \ - --delete-branch-on-merge \ - --default-branch develop + --default-branch develop \ + --delete-branch-on-merge env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} From 4c26c39b14c0f1727d60bee40d508c7d2ebc8df6 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 15:20:25 +0900 Subject: [PATCH 07/19] chore --- .github/protection.json | 4 ++-- .github/workflows/setting.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/protection.json b/.github/protection.json index 509f0774..987fa795 100644 --- a/.github/protection.json +++ b/.github/protection.json @@ -1,5 +1,5 @@ { - "main": { + "develop": { "allow_deletions": false, "allow_force_pushes": false, "enforce_admins": false, @@ -14,7 +14,7 @@ }, "restrictions": null }, - "develop": { + "main": { "allow_deletions": false, "allow_force_pushes": false, "enforce_admins": false, diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index 65775b8f..8e3cf270 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - .github/workflows/setting.yml + - .github/environments.json - .github/protection.json schedule: - cron: "0 0 * * *" From 6dd2554bdea0b933986958fcf49dc1e4c4ccc2df Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 15:26:48 +0900 Subject: [PATCH 08/19] fix: GitHub Pages --- .github/workflows/gh-deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gh-deploy.yml b/.github/workflows/gh-deploy.yml index 27cecc5a..80ac3914 100644 --- a/.github/workflows/gh-deploy.yml +++ b/.github/workflows/gh-deploy.yml @@ -20,6 +20,8 @@ jobs: deploy: runs-on: ubuntu-latest + environment: GitHub Pages + steps: - name: Checkout uses: actions/checkout@v6 From 4f90bb1f7114fb12822deaa3a2c969750f374452 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 15:30:40 +0900 Subject: [PATCH 09/19] chore --- .github/environments.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/environments.json b/.github/environments.json index 42fbd3c4..656e3b8e 100644 --- a/.github/environments.json +++ b/.github/environments.json @@ -18,7 +18,7 @@ "GitHub Pages": { "deployment_branch_policy": { "protected_branches": false, - "custom_branch_policies": true + "custom_branch_policies": false }, "reviewers": [], "wait_timer": 0 From 1f396933f1bbab2b1ef811fa49775e3c3af6c0eb Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 16:19:01 +0900 Subject: [PATCH 10/19] fix: chore --- .github/environments.json | 5 +---- .github/workflows/setting.yml | 16 ++++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/environments.json b/.github/environments.json index 656e3b8e..dbc1f7b5 100644 --- a/.github/environments.json +++ b/.github/environments.json @@ -16,10 +16,7 @@ "wait_timer": 0 }, "GitHub Pages": { - "deployment_branch_policy": { - "protected_branches": false, - "custom_branch_policies": false - }, + "deployment_branch_policy": null, "reviewers": [], "wait_timer": 0 } diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index 8e3cf270..032eac04 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -71,20 +71,20 @@ jobs: - name: Apply Branch Protection Rules run: | - if [ ! -f "${{ env.CONFIG_FILE }}" ]; then + if [ ! -f ${{ env.CONFIG_FILE }} ]; then echo "Error: ${{ env.CONFIG_FILE }} not found!" exit 1 fi - BRANCHES=$(jq -r 'keys[]' "${{ env.CONFIG_FILE }}") + BRANCHES=$(jq -r 'keys[]' ${{ env.CONFIG_FILE }}) for BRANCH in $BRANCHES; do if ! gh api "repos/${{ github.repository }}/branches/$BRANCH" --silent >/dev/null 2>&1; then - echo "Warning: Branch '$BRANCH' does not exist in this repository. Skipping..." + echo "Warning: Branch ${{ env.CONFIG_FILE }} does not exist in this repository. Skipping..." continue fi - jq -c ".\"$BRANCH\"" "$CONFIG_FILE" | gh api -X PUT "repos/${{ github.repository }}/branches/$BRANCH/protection" --input - + jq -c ."$BRANCH" ${{ env.CONFIG_FILE }} | gh api -X PUT "repos/${{ github.repository }}/branches/$BRANCH/protection" --input - done env: CONFIG_FILE: .github/protection.json @@ -116,12 +116,16 @@ jobs: - name: Configure Environment run: | - if [ ! -f "${{ env.CONFIG_FILE }}" ]; then + if [ ! -f ${{ env.CONFIG_FILE }} ]; then echo "Error: ${{ env.CONFIG_FILE }} not found!" exit 1 fi - jq -c ".\"${{ env.ENVIRONMENT_NAME }}\"" "${{ env.CONFIG_FILE }}" | gh api -X PUT "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}" --input - + CUSTOM_BRANCH_POLICIES=$(jq -r ".${{ env.ENVIRONMENT_NAME }}.deployment_branch_policy.custom_branch_policies" ${{ env.CONFIG_FILE }}) + + if [ "$CUSTOM_BRANCH_POLICIES" != true ]; then + exit 0 + fi gh api -X POST "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" \ -f "name=${{ env.BRANCH_NAME }}" \ From e0b3b379007e3f5ddbcf71123cf905c624aae859 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 16:21:05 +0900 Subject: [PATCH 11/19] fix: chore --- .github/workflows/setting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index 032eac04..db704edf 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -121,7 +121,7 @@ jobs: exit 1 fi - CUSTOM_BRANCH_POLICIES=$(jq -r ".${{ env.ENVIRONMENT_NAME }}.deployment_branch_policy.custom_branch_policies" ${{ env.CONFIG_FILE }}) + CUSTOM_BRANCH_POLICIES=$(jq -r ".\"${{ env.ENVIRONMENT_NAME }}\".deployment_branch_policy.custom_branch_policies" ${{ env.CONFIG_FILE }}) if [ "$CUSTOM_BRANCH_POLICIES" != true ]; then exit 0 From 9aaf9db8005482d02168ed740b72db183526951a Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 16:25:52 +0900 Subject: [PATCH 12/19] fix: chore --- .github/workflows/setting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index db704edf..601ea4c7 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -84,7 +84,7 @@ jobs: continue fi - jq -c ."$BRANCH" ${{ env.CONFIG_FILE }} | gh api -X PUT "repos/${{ github.repository }}/branches/$BRANCH/protection" --input - + jq -c ".\"$BRANCH\"" ${{ env.CONFIG_FILE }} | gh api -X PUT "repos/${{ github.repository }}/branches/$BRANCH/protection" --input - done env: CONFIG_FILE: .github/protection.json From a7d026e17de9a7212be3f6fb5fe743c674ff8b30 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 16:31:36 +0900 Subject: [PATCH 13/19] fix: chore --- .github/workflows/setting.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index 601ea4c7..0f96ebc4 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -124,6 +124,7 @@ jobs: CUSTOM_BRANCH_POLICIES=$(jq -r ".\"${{ env.ENVIRONMENT_NAME }}\".deployment_branch_policy.custom_branch_policies" ${{ env.CONFIG_FILE }}) if [ "$CUSTOM_BRANCH_POLICIES" != true ]; then + gh api -X DELETE "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" exit 0 fi From f5a0e2af48aa6a67f0e1aa9516178ff6e16d057b Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 16:55:15 +0900 Subject: [PATCH 14/19] fix: chore --- .github/environments.json | 2 +- .github/workflows/setting.yml | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/environments.json b/.github/environments.json index dbc1f7b5..2ee5f8d0 100644 --- a/.github/environments.json +++ b/.github/environments.json @@ -15,7 +15,7 @@ "reviewers": [], "wait_timer": 0 }, - "GitHub Pages": { + "Pages": { "deployment_branch_policy": null, "reviewers": [], "wait_timer": 0 diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index 0f96ebc4..e9057fc1 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -43,14 +43,15 @@ jobs: - name: Set GitHub Pages Source run: | - gh api -X POST "repos/${{ github.repository }}/pages" \ + gh api -X POST ${{ env.ENDPOINT }} \ -f "source[branch]=${{ env.BRANCH }}" \ -f "source[path]=${{ env.TARGET_PATH }}" --silent \ || \ - gh api -X PUT "repos/${{ github.repository }}/pages" \ + gh api -X PUT ${{ env.ENDPOINT }} \ -f "source[branch]=${{ env.BRANCH }}" \ -f "source[path]=${{ env.TARGET_PATH }}" env: + ENDPOINT: repos/${{ github.repository }}/pages BRANCH: gh-pages TARGET_PATH: / GH_TOKEN: ${{ steps.generate-token.outputs.token }} @@ -79,15 +80,16 @@ jobs: BRANCHES=$(jq -r 'keys[]' ${{ env.CONFIG_FILE }}) for BRANCH in $BRANCHES; do - if ! gh api "repos/${{ github.repository }}/branches/$BRANCH" --silent >/dev/null 2>&1; then + if ! gh api "${{ env.ENDPOINT }}/$BRANCH" --silent >/dev/null 2>&1; then echo "Warning: Branch ${{ env.CONFIG_FILE }} does not exist in this repository. Skipping..." continue fi - jq -c ".\"$BRANCH\"" ${{ env.CONFIG_FILE }} | gh api -X PUT "repos/${{ github.repository }}/branches/$BRANCH/protection" --input - + jq -c ".\"$BRANCH\"" ${{ env.CONFIG_FILE }} | gh api -X PUT "${{ env.ENDPOINT }}/$BRANCH/protection" --input - done env: CONFIG_FILE: .github/protection.json + ENDPOINT: repos/${{ github.repository }}/branches GH_TOKEN: ${{ steps.generate-token.outputs.token }} environments: @@ -100,7 +102,7 @@ jobs: branch: develop - environment: Production branch: main - - environment: GitHub Pages + - environment: Pages branch: gh-pages steps: @@ -121,18 +123,21 @@ jobs: exit 1 fi + jq -c ".\"${{ env.ENVIRONMENT_NAME }}\"" ${{ env.CONFIG_FILE }} | gh api -X PUT "${{ env.ENDPOINT }}/${{ env.ENVIRONMENT_NAME }}" --input - + CUSTOM_BRANCH_POLICIES=$(jq -r ".\"${{ env.ENVIRONMENT_NAME }}\".deployment_branch_policy.custom_branch_policies" ${{ env.CONFIG_FILE }}) if [ "$CUSTOM_BRANCH_POLICIES" != true ]; then - gh api -X DELETE "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" + gh api -X DELETE "${{ env.ENDPOINT }}/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" exit 0 fi - gh api -X POST "repos/${{ github.repository }}/environments/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" \ + gh api -X POST "${{ env.ENDPOINT }}/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" \ -f "name=${{ env.BRANCH_NAME }}" \ -f "type=branch" env: CONFIG_FILE: .github/environments.json BRANCH_NAME: ${{ matrix.branch }} + ENDPOINT: repos/${{ github.repository }}/environments ENVIRONMENT_NAME: ${{ matrix.environment }} GH_TOKEN: ${{ steps.generate-token.outputs.token }} From 35e3da922ff2bf019843df8f25a068a14429bdf2 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 17:14:46 +0900 Subject: [PATCH 15/19] fix: chore --- .github/workflows/setting.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index e9057fc1..e5e3fc82 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -128,7 +128,10 @@ jobs: CUSTOM_BRANCH_POLICIES=$(jq -r ".\"${{ env.ENVIRONMENT_NAME }}\".deployment_branch_policy.custom_branch_policies" ${{ env.CONFIG_FILE }}) if [ "$CUSTOM_BRANCH_POLICIES" != true ]; then - gh api -X DELETE "${{ env.ENDPOINT }}/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" + IDS=$(gh api "${{ env.ENDPOINT }}/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies" --jq '.branch_policies[].id' || true) + for ID in $IDS; do + gh api -X DELETE "${{ env.ENDPOINT }}/${{ env.ENVIRONMENT_NAME }}/deployment-branch-policies/$ID" --silent || true + done exit 0 fi From 5e6d04f13e1316602d46938deb5f04fecfc8034f Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 17:19:41 +0900 Subject: [PATCH 16/19] fix: chore --- .github/workflows/gh-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-deploy.yml b/.github/workflows/gh-deploy.yml index 80ac3914..2f12481a 100644 --- a/.github/workflows/gh-deploy.yml +++ b/.github/workflows/gh-deploy.yml @@ -20,7 +20,7 @@ jobs: deploy: runs-on: ubuntu-latest - environment: GitHub Pages + environment: Pages steps: - name: Checkout From 33a9dcd5f852d32fab64544dd4ffa35b71549cc5 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 17:25:46 +0900 Subject: [PATCH 17/19] fix: chore --- .github/workflows/setting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index e5e3fc82..81e82ec9 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -81,7 +81,7 @@ jobs: for BRANCH in $BRANCHES; do if ! gh api "${{ env.ENDPOINT }}/$BRANCH" --silent >/dev/null 2>&1; then - echo "Warning: Branch ${{ env.CONFIG_FILE }} does not exist in this repository. Skipping..." + echo "Warning: Branch $BRANCH does not exist in this repository. Skipping..." continue fi From d8b9f4170ac23c147402ae7262e4cb8fb0bf9d38 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 17:30:09 +0900 Subject: [PATCH 18/19] fix: chore --- .github/environments.json | 2 +- .github/workflows/gh-deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/environments.json b/.github/environments.json index 2ee5f8d0..2cbf5700 100644 --- a/.github/environments.json +++ b/.github/environments.json @@ -15,7 +15,7 @@ "reviewers": [], "wait_timer": 0 }, - "Pages": { + "github-pages": { "deployment_branch_policy": null, "reviewers": [], "wait_timer": 0 diff --git a/.github/workflows/gh-deploy.yml b/.github/workflows/gh-deploy.yml index 2f12481a..57ffec7a 100644 --- a/.github/workflows/gh-deploy.yml +++ b/.github/workflows/gh-deploy.yml @@ -20,7 +20,7 @@ jobs: deploy: runs-on: ubuntu-latest - environment: Pages + environment: github-pages steps: - name: Checkout From d764505ce8a8e2079c89d070548aad8bcb8a354c Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Thu, 5 Feb 2026 17:32:49 +0900 Subject: [PATCH 19/19] fix: chore --- .github/workflows/setting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setting.yml b/.github/workflows/setting.yml index 81e82ec9..06e8a0a5 100644 --- a/.github/workflows/setting.yml +++ b/.github/workflows/setting.yml @@ -102,7 +102,7 @@ jobs: branch: develop - environment: Production branch: main - - environment: Pages + - environment: github-pages branch: gh-pages steps: