Skip to content

Commit

Permalink
Merge pull request #1 from hankei6km:topic/setup
Browse files Browse the repository at this point in the history
chore: Setup
  • Loading branch information
hankei6km authored Dec 16, 2023
2 parents f6d0aaf + 3917ebd commit b0690ff
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 21 deletions.
53 changes: 32 additions & 21 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
{
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye",
"customizations": {
"vscode": {
"settings": {
"json.schemas": [
{
"fileMatch": [
"*/devcontainer-feature.json"
],
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json"
}
]
},
"extensions": [
"mads-hartmann.bash-ide-vscode"
]
}
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye",
"customizations": {
"vscode": {
"settings": {
"json.schemas": [
{
"fileMatch": ["*/devcontainer-feature.json"],
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json"
}
]
},
"extensions": ["mads-hartmann.bash-ide-vscode"]
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
"codespaces": {
"settings": {
"json.schemas": [
{
"fileMatch": ["*/devcontainer-feature.json"],
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json"
}
]
},
"extensions": ["mads-hartmann.bash-ide-vscode"]
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "node"
},
"remoteUser": "node",
"updateContentCommand": "npm install -g @devcontainers/cli"
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"remoteUser": "node",
"updateContentCommand": "npm install -g @devcontainers/cli"
}
6 changes: 6 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -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/**'
15 changes: 15 additions & 0 deletions .github/workflows/scope-label.yml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions .github/workflows/sem-pr-label.yml
Original file line number Diff line number Diff line change
@@ -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 }}
27 changes: 27 additions & 0 deletions scripts/init-labels.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b0690ff

Please sign in to comment.