From fde5ef2af8ed14242bcdc1fed2476fc5725a72f1 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Sat, 21 Dec 2024 11:20:39 +0900 Subject: [PATCH] add format workflow --- .github/workflows/format.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..96b70a2d --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,31 @@ +name: 👔 Format + +on: + workflow_dispatch: null + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + - name: Install deps + run: npm i -f + - name: Format + run: npm run format + - name: Commit + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + git add . + if [ -z "$(git status --porcelain)" ]; then + echo "no formatting changed" + exit 0 + fi + git commit -m "chore: format" + git push + echo "pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"