Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

format code

format code #60

Workflow file for this run

name: format code
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
inputs:
ignoreLock:
description: 'Ignore flake.lock'
required: false
default: false
type: boolean
jobs:
formatCode:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: config for git
run: |
git config user.email "<>"
git config user.name "Formatting Bot"
- name: delete Lockfile
if: ${{ inputs.ignoreLock }}
run: rm flake.lock
- name: format code
run: nix develop -c format
- name: push formated code
run: |
git add src
if [ -n "$(git status --porcelain)" ]; then
git commit -m "[Formatting Bot] format code according to tidyverse style guide"
git push origin
fi