Skip to content

Commit

Permalink
Merge pull request #82 from 9renpoto/feature
Browse files Browse the repository at this point in the history
feat: add linters
  • Loading branch information
9renpoto authored Dec 3, 2023
2 parents 61cc470 + 7fe73bf commit bb1dd35
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 19 deletions.
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 1 addition & 12 deletions .github/mergeable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -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:
- '*'
17 changes: 17 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .github/workflows/bump-schedule.yml
Original file line number Diff line number Diff line change
@@ -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
71 changes: 71 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -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 }}'
13 changes: 13 additions & 0 deletions .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions .github/workflows/secretlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Secretlint
on: [push, pull_request]
permissions:
contents: read
jobs:
test:
name: "Secretlint"
runs-on: ubuntu-latest
container: secretlint/secretlint:v8.0.0
steps:
- name: checkout
uses: actions/checkout@v3
- name: Lint with Secretlint
run: secretlint "**/*"
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ This is an example file with default selections.

## Install

```
```sh

```

## Usage

```
```sh

```

Expand Down

0 comments on commit bb1dd35

Please sign in to comment.