-
Notifications
You must be signed in to change notification settings - Fork 45
43 lines (43 loc) · 1.18 KB
/
dotnet-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
42
43
name: Python checks
on:
pull_request:
types: [assigned]
branches:
- "*"
workflow_dispatch:
inputs:
placeholder:
description: "placeholder, no effect"
required: false
jobs:
check_license_and_format:
name: License and format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: format
id: format_check
run: |
bash ./scripts/format.sh --git
- name: install clang-format
id: clang-format
run: sudo apt install clang-format
- name: check for changes
run: |
if git diff --exit-code; then
echo "has_changes=false" >> $GITHUB_ENV
else
echo "has_changes=true" >> $GITHUB_ENV
fi
- name: Git push
if: ${{ env.has_changes == 'true' }}
id: git_push
run: |
git config --global user.email "[email protected]"
git config --global user.name "ci-bot"
git add -u
git commit -m "auto format by CI"
git push