Skip to content

update actions

update actions #71

name: Auto Format Python Code with Black
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
run: echo $(echo $GITHUB_REF | cut -d / -f 3)
- if: github.event_name == 'push'
uses: actions/checkout@v2
- if: github.event_name == 'pull_request'
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Run Black
uses: datadog/action-py-black-formatter@v2
- name: Commit changes
id: commit_changes
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: format & update for python
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
signoff: false
delete-branch: true