Format the code #1
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: Format the code | |
on: | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
createPullRequest: | |
permissions: | |
contents: write # to create branch (peter-evans/create-pull-request) | |
pull-requests: write # to create a PR (peter-evans/create-pull-request) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
python -m pip install --upgrade pip setuptools | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: pip cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
pip install black==22.3.0 isort==5.10.1 flake8==4.0.1 | |
- name: Format the code | |
run: sh shell/format.sh | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
commit-message: format the code | |
committer: A. Unique TensorFlower <[email protected]> | |
author: A. Unique TensorFlower <[email protected]> | |
branch: format | |
delete-branch: true | |
title: 'Format the code' | |
body: | | |
This is a pull request automatically created by a Github Action to format the code. | |
If there is any conflict, click the run workflow button on | |
[this page](https://github.com/keras-team/tf-keras/actions/workflows/format.yml). | |
labels: | | |
ready to pull | |
draft: false |