-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: hand7s <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Yaroslav Malykh <[email protected]>
- Loading branch information
1 parent
79a2720
commit 6bb0d9a
Showing
10 changed files
with
260 additions
and
173 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,46 @@ | ||
name: Format Code | ||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
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/magic-nix-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 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: master | ||
|
||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"default": true, | ||
"MD033": false, | ||
"MD013": false | ||
"default": true, | ||
"MD033": false, | ||
"MD013": false | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"nixpkgs": { | ||
"branch": "master", | ||
"description": "Nix Packages collection & NixOS", | ||
"homepage": "", | ||
"owner": "NixOS", | ||
"repo": "nixpkgs", | ||
"rev": "5785b6bb5eaae44e627d541023034e1601455827", | ||
"sha256": "19zq0d0n2j47kqg8i3wana4vqv5xn5qvvm5bv7wh3fp4yd8x7r18", | ||
"type": "tarball", | ||
"url": "https://github.com/NixOS/nixpkgs/archive/5785b6bb5eaae44e627d541023034e1601455827.tar.gz", | ||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
} | ||
"nixpkgs": { | ||
"branch": "master", | ||
"description": "Nix Packages collection & NixOS", | ||
"homepage": "", | ||
"owner": "NixOS", | ||
"repo": "nixpkgs", | ||
"rev": "5785b6bb5eaae44e627d541023034e1601455827", | ||
"sha256": "19zq0d0n2j47kqg8i3wana4vqv5xn5qvvm5bv7wh3fp4yd8x7r18", | ||
"type": "tarball", | ||
"url": "https://github.com/NixOS/nixpkgs/archive/5785b6bb5eaae44e627d541023034e1601455827.tar.gz", | ||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
} | ||
} |
Oops, something went wrong.