Astro.jsを作成したものに変更 #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint Project | |
on: | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Install Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: 20 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install packages | |
run: pnpm install | |
- name: Format | |
run: pnpm run format | |
- name: Determine the branch name | |
id: get_branch | |
run: echo "::set-output name=branch::$(echo ${GITHUB_HEAD_REF})" | |
- name: Commit Format | |
run: | | |
git add -N . # 新規ファイルを含める | |
if ! git diff --exit-code --quiet | |
then | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "chore: fix format." | |
git push origin HEAD:${{ steps.get_branch.outputs.branch }} | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
- name: Exec Lint | |
run: pnpm run lint |