From 7ea43d2e0a3ae5ebb239ae0e6a974077d205daca Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 3 Dec 2023 10:33:15 +0900 Subject: [PATCH 1/4] feat: add new entry --- .github/dependabot.yml | 5 -- .github/mergeable.yml | 13 +----- .github/release.yml | 21 +++++++++ .github/workflows/actionlint.yml | 17 +++++++ .github/workflows/bump-schedule.yml | 12 +++++ .github/workflows/bump.yml | 71 +++++++++++++++++++++++++++++ .github/workflows/cspell.yml | 13 ++++++ 7 files changed, 135 insertions(+), 17 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/actionlint.yml create mode 100644 .github/workflows/bump-schedule.yml create mode 100644 .github/workflows/bump.yml create mode 100644 .github/workflows/cspell.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index eacbc3a..eca2adf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,8 +2,3 @@ version: 2 updates: - package-ecosystem: github-actions directory: '/' - schedule: - interval: daily - time: '03:00' - timezone: 'Asia/Tokyo' - open-pull-requests-limit: 99 diff --git a/.github/mergeable.yml b/.github/mergeable.yml index 574ccba..36bca64 100644 --- a/.github/mergeable.yml +++ b/.github/mergeable.yml @@ -2,18 +2,7 @@ version: 2 mergeable: - when: pull_request.*, pull_request_review.* validate: - - do: title - must_exclude: - regex: ^\[WIP\] - message: This is work in progress. Do not merge yet. - - do: description - must_exclude: - regex: TBA - message: This is default templates yet. - no_empty: - enabled: true - message: must include specs - do: label must_include: - regex: ^Type + regex: bug|documentation|enhancement|dependencies message: must include types diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..53400a4 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,21 @@ +# .github/release.yml + +changelog: + exclude: + labels: + - ignore-for-release + authors: + - octocat + categories: + - title: ':bug: Type: Bug' + labels: + - 'bug' + - title: ':memo: Documentation' + labels: + - 'documentation' + - title: ':rocket: Type: Feature' + labels: + - 'enhancement' + - title: Other Changes + labels: + - '*' diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 0000000..a343b3b --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,17 @@ +name: actionlint + +on: + pull_request: + paths: + - '.github/actions/**' + - '.github/workflows/**' + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: reviewdog/action-actionlint@v1 + with: + reporter: github-pr-review + fail_on_error: true diff --git a/.github/workflows/bump-schedule.yml b/.github/workflows/bump-schedule.yml new file mode 100644 index 0000000..22a9440 --- /dev/null +++ b/.github/workflows/bump-schedule.yml @@ -0,0 +1,12 @@ +name: Bump version (cron) + +on: + schedule: + - cron: '15 3 * * TUE' + +jobs: + scheduled_bump: + uses: ./.github/workflows/bump.yml + secrets: inherit + with: + semver: minor diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..8a893c3 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,71 @@ +name: Bump version + +on: + workflow_dispatch: + inputs: + semver: + description: 'Which SemVer' + required: true + default: 'patch' + type: choice + options: + - major + - minor + - patch + workflow_call: + inputs: + semver: + description: The image_name to build for. + required: true + type: string +jobs: + bump: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - run: npm version ${{ inputs.semver }} --no-git-tag-version --workspaces --no-workspaces-update + + - name: generate new version and save to env variable + id: get_version + run: | + echo "NEW_VERSION=$(cat < apps/web/package.json | jq -r .version)" >> "$GITHUB_OUTPUT" + + - name: Generate release notes + uses: actions/github-script@v7 + id: get_release_note + env: + NEW_VERSION: ${{steps.get_version.outputs.NEW_VERSION}} + with: + result-encoding: string + script: | + const notes = await github.rest.repos.generateReleaseNotes( + { + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: process.env.NEW_VERSION, + } + ); + return notes.data.body; + + - run: | + cat << EOF >> new + ## v${{ steps.get_version.outputs.NEW_VERSION }} ($(date '+%Y-%m-%d')) + ${{ steps.get_release_note.outputs.result }} + EOF + - run: cat new ./CHANGELOG.md > temp + - run: mv temp ./CHANGELOG.md + - run: rm new + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + base: main + branch: main-${{ steps.get_version.outputs.NEW_VERSION }} + commit-message: 'bump: v${{ steps.get_version.outputs.NEW_VERSION }}' + body: ${{ steps.get_release_note.outputs.result }} + title: 'chore: bump v${{ steps.get_version.outputs.NEW_VERSION }}' + labels: | + documentation + draft: true + milestone: 'v${{ steps.get_version.outputs.NEW_VERSION }}' diff --git a/.github/workflows/cspell.yml b/.github/workflows/cspell.yml new file mode 100644 index 0000000..0d3d2dc --- /dev/null +++ b/.github/workflows/cspell.yml @@ -0,0 +1,13 @@ +name: 'Check spelling' +on: + pull_request: + +jobs: + spellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: streetsidesoftware/cspell-action@v5 + with: + files: "*.{rs,ts,tsx,md}" + incremental_files_only: false From f6a9a6a1887a1d578c3c3d95890feb0c36e7f732 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 3 Dec 2023 10:33:31 +0900 Subject: [PATCH 2/4] feat: add new entry --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7768d66..4df3b1e 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ This is an example file with default selections. ## Install -``` +```sh ``` ## Usage -``` +```sh ``` From d70c6d0973892b009f39b4355793048cf494d3d6 Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 3 Dec 2023 10:52:03 +0900 Subject: [PATCH 3/4] feat: add pre-commit config --- .github/workflows/secretlint.yml | 19 +++++++++++++++++++ .pre-commit-config.yaml | 12 ++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/secretlint.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/secretlint.yml b/.github/workflows/secretlint.yml new file mode 100644 index 0000000..c2e6d63 --- /dev/null +++ b/.github/workflows/secretlint.yml @@ -0,0 +1,19 @@ +name: Secretlint +on: [push, pull_request] +permissions: + contents: read +jobs: + test: + name: "Secretlint" + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: setup Node.js + uses: actions/setup-node@v3 + with: + node-version: lts/* + - name: Install + run: npm install + - name: Lint with Secretlint + run: npx secretlint "**/*" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8763ad9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + # - repo: https://github.com/streetsidesoftware/cspell-cli + # rev: v8.0.0 + # hooks: + # - id: cspell + + - repo: local + hooks: + - id: secretlint + name: secretlint + language: docker_image + entry: secretlint/secretlint:latest secretlint From 7fe73bf0099287ea09d38dea3a650b71d0cf3afc Mon Sep 17 00:00:00 2001 From: Keisuke Umeno <9renpoto@gmail.com> Date: Sun, 3 Dec 2023 10:57:19 +0900 Subject: [PATCH 4/4] chore: secretlint via dockerfile --- .github/workflows/secretlint.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/secretlint.yml b/.github/workflows/secretlint.yml index c2e6d63..48724e0 100644 --- a/.github/workflows/secretlint.yml +++ b/.github/workflows/secretlint.yml @@ -6,14 +6,9 @@ jobs: test: name: "Secretlint" runs-on: ubuntu-latest + container: secretlint/secretlint:v8.0.0 steps: - name: checkout uses: actions/checkout@v3 - - name: setup Node.js - uses: actions/setup-node@v3 - with: - node-version: lts/* - - name: Install - run: npm install - name: Lint with Secretlint - run: npx secretlint "**/*" + run: secretlint "**/*"