update from master branch #2
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: 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 |