Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create App #1

Merged
merged 8 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ref: https://docs.github.com/ja/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners
* @hakadoriya/owner
31 changes: 31 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- markdownlint-disable MD004 MD041 -->

## Ticket / Issue Number

> **Note**
> *Please fill in the ticket or issue number.*
> > Example:
> >
> > #1

## What's changed

> **Note**
> *Please explain what changes this pull request will make.*
> > Example:
> >
> > - Added functionality to perform 'bar' on 'foo'.

## Check List

- [ ] Assign reviewers
- [ ] Assign assignees
- [ ] Assign labels
- [ ] Add appropriate test cases

## Remark

> **Note**
> *Please provide additional remarks if necessary.*

<!-- markdownlint-enable MD004 MD041 -->
38 changes: 38 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# https://docs.github.com/ja/repositories/releasing-projects-on-github/automatically-generated-release-notes
changelog:
categories:
- title: "💥 BREAKING CHANGES"
labels:
- BREAKING CHANGE
- title: "⬆️ Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)"
labels:
- build
- dependencies
- title: "👷 Changes to our CI configuration files and scripts (examples: CircleCi, SauceLabs)"
labels:
- ci
- title: "📝 Documentation only changes"
labels:
- docs
- title: "✨ A new feature"
labels:
- feat
- title: "🐛 A bug fix"
labels:
- fix
- title: "⚡️ A code change that improves performance"
labels:
- perf
- title: "♻️ A code change that neither fixes a bug nor adds a feature"
labels:
- refactor
- title: "✅ Adding missing tests or correcting existing tests"
labels:
- test
- title: "🚨 Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"
labels:
- style
- title: "🧑‍💻 Changes to the build process or auxiliary tools and libraries such as documentation generation"
labels:
- chore
- "*"
20 changes: 20 additions & 0 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: auto-assign

on:
pull_request:
types:
- opened
- ready_for_review
- reopened

jobs:
auto-assign:
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]'
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- if: ${{ toJSON(github.event.pull_request.assignees) == '[]' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr --repo ${{ github.repository }} edit ${{ github.event.pull_request.number }} --add-assignee "${{ github.event.pull_request.user.login }}"
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ref: https://vite.dev/guide/static-deploy

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
43 changes: 43 additions & 0 deletions .github/workflows/final-newline-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: final-newline-checker

on:
pull_request:
# NO paths filter

jobs:
final-newline-checker:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: hakadoriya-actions/[email protected]
id: final-newline-checker
with:
# NOTE: If you want to fail on missing final newline, set this to true
#fail-on-missing: true
#paths: |-
# ^action.yml
# ^missing-final-newline.md
paths-ignore: |-
.*\.ico$
.*\.png$
- name: Submit PR comment if missing final newline
if: ${{ steps.final-newline-checker.outputs.missing == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
# Create comment body
cat <<EOF | perl -pe 's/\\n/\n/g' | tee /tmp/gh-pr-comment-body.md
## 🚨 Missing final newline

The following files are missing final newline.

\`\`\`
${{ steps.final-newline-checker.outputs.missing-files }}
\`\`\`
EOF
# Submit PR comment
gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/gh-pr-comment-body.md
# fail the workflow
exit 1
80 changes: 80 additions & 0 deletions .github/workflows/label-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: label-checker

# # Dependabot
# gh label create --force "dependencies" --description "Pull requests that update a dependency file" --color 0366D6
# gh label create --force "go" --description "Pull requests that update Go code" --color 16E2E2
# gh label create --force "github_actions" --description "Pull requests that update GitHub Actions code" --color 000000
# gh label create --force "docker" --description "Pull requests that update Docker code" --color 21CEFF

# # Renovate
# gh label create --force "renovate" --description "Renovate" --color 009485

# # Commit prefix
# gh label create --force "BREAKING CHANGE" --description "BREAKING CHANGES" --color FF0303
# gh label create --force "build" --description "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)" --color 5319E7
# gh label create --force "ci" --description "Changes to our CI configuration files and scripts (examples: CircleCi, SauceLabs)" --color 53C4EE
# gh label create --force "docs" --description "Documentation only changes" --color 1B3E44
# gh label create --force "feat" --description "A new feature" --color 0EAA80
# gh label create --force "fix" --description "A bug fix" --color 1D76DB
# gh label create --force "perf" --description "A code change that improves performance" --color A2EEEF
# gh label create --force "refactor" --description "A code change that neither fixes a bug nor adds a feature" --color C5DEF5
# gh label create --force "test" --description "Adding missing tests or correcting existing tests" --color 1D76DB
# gh label create --force "chore" --description "Changes to the build process or auxiliary tools and libraries such as documentation generation" --color 20313F

on:
pull_request:
types:
- opened
- edited
- labeled
- unlabeled
- ready_for_review
- reopened
- synchronize

env:
LABELS: "BREAKING CHANGE,build,ci,docs,feat,fix,perf,refactor,test,chore"

jobs:
label-checker:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: read
pull-requests: write # required to add labels
statuses: read
checks: read
repository-projects: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }} # needed for gh pr view
- name: Check labels
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
# Check labels
set -Eeuo pipefail -x

# If any of the labels are present, exit with success
if [[ -n "$(gh pr view --json labels --jq ".labels[].name" | grep -E "^($(tr , "|" <<<"${LABELS:?}"))$")" ]]; then
exit 0
fi

# Add labels based on PR title
GH_PR_TITLE=$(gh pr view --json title --jq .title)
gh label list --json name --jq ".[].name" | while read -r LINE; do
awk -F: "/^${LINE-}(\([^\)]+\))?:/ {print \$1}" <<<"${GH_PR_TITLE:?}" | grep -Eo "^${LINE:?}" || true # NOTE: Ignore the return value of grep because we just want to output the string
done | xargs -t -I{} gh pr edit --add-label {}

# If any of the labels are present, exit with success
while read -r LINE; do
if grep -E "^($(tr , "|" <<<"${LABELS:?}"))$" <<<"${LINE-}"; then
exit 0
fi
done <<<"$(gh pr view --json labels --jq ".labels[].name")"

# If none of the labels are present, exit with error
exit 1
23 changes: 23 additions & 0 deletions .github/workflows/task-list-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: task-list-checker

on:
pull_request:
types:
- opened
- edited
- ready_for_review
- reopened
- synchronize

jobs:
task-list-checker:
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: read
steps:
- uses: hakadoriya-actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/typo-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: typo-checker
# ^^^^^^^^^^^^
# https://github.com/organization/repository/workflows/typo-checker/badge.svg
# ^^^^^^^^^^^^

on:
pull_request:
workflow_dispatch:
inputs: {}

# NOTE: If commit & push continuously, cancel the workflow other than the latest commit.
concurrency:
group: ${{ github.workflow }}-${{ github.base_ref }}-${{ github.head_ref }}-${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

env:
WORKDIR: .

defaults:
run:
shell: bash

jobs:
typo-checker: # NOTE: for Branch protection rule `Status checks that are required.`
runs-on: ubuntu-latest # ref. https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
steps:
- uses: actions/checkout@v4
- name: DEBUG
shell: bash
run: |
cat <<'DEBUG_DOC'
== DEBUG =======================================================
github.ref: ${{ github.ref }}
github.event_name: ${{ github.event_name }}
-- toJSON(github.event.inputs) ---------------------------------
${{ toJSON(github.event.inputs) }}
-- toJSON(github) ----------------------------------------------
${{ toJSON(github) }}
================================================================
DEBUG_DOC
- name: Check spelling
uses: crate-ci/typos@master
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# [hakadoriya.github.io](https://hakadoriya.github.io)
Loading
Loading