-
Notifications
You must be signed in to change notification settings - Fork 8
41 lines (39 loc) · 1.19 KB
/
auto-format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: auto-format
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format:
# Check if the PR is not from a fork
# if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0'
- name: Restore
run: |
dotnet restore
dotnet tool restore
- name: Execute Fantomas
run: |
find ./src -type f -name "*.fs" -not -path "*obj*" | xargs dotnet fantomas
- name: Check for modified files
id: git-check
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT
- name: Push changes
if: steps.git-check.outputs.modified == 'true'
run: |
git config user.name "d-edge automation"
git config user.email "<>"
git commit -am "Automated changes"
git push