This repository has been archived by the owner on Jul 20, 2024. It is now read-only.
Auto Format #197
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: "Auto Format" | |
on: | |
workflow_dispatch: | |
schedule: | |
# 開発の動きがない時間を想定し、毎日午前 6 時に実施 | |
- cron: '0 21 * * *' | |
jobs: | |
format: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Create GitHub App Token | |
uses: actions/[email protected] | |
id: app-token | |
with: | |
app-id: ${{ vars.BOT_APP_ID }} | |
private-key: ${{ secrets.BOT_PRIVATE_KEY }} | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version-file: 'package.json' | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
- name: Clean install using pnpm | |
shell: bash | |
run: pnpm install --no-frozen-lockfile | |
- name: Run prettier | |
shell: bash | |
run: pnpm run format | |
- name: Create pull request | |
uses: peter-evans/[email protected] | |
with: | |
token: ${{ steps.app-token.outputs.token }} | |
commit-message: ':recycle: Auto format' | |
committer: GitHub <[email protected]> | |
author: albelium-bot[bot] <154823176+albelium-bot[bot]@users.noreply.github.com> | |
signoff: false | |
title: ':recycle: Auto Format' | |
body: 'This was automatically generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})' | |
labels: | | |
ignore-for-release | |
base: 'main' | |
branch: 'workflow/auto-format' | |
branch-suffix: 'short-commit-hash' |