feat(update): update to v5.11.1 (#50) #173
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: Format Code | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: ahmadnassri/action-workflow-queue@v1 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/flakehub-cache-action@main | |
- name: Install formatting tools | |
run: nix-env -f "<nixpkgs>" -iA nixfmt-rfc-style treefmt yamlfmt jsonfmt markdownlint-cli | |
- name: Add new branch | |
run: git checkout -b treefmt-code | |
- name: Run treefmt | |
uses: isbecker/treefmt-action@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
version: "latest" | |
fail_on_change: "false" | |
- name: Commit changes | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
if ! git diff --quiet; then | |
git pull | |
git add . | |
git commit -m "refactor(*): automated formatting" | |
fi | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref_name }} |