mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-12-19 02:07:27 +08:00
* directory_writer * fixup: Format Python code with psf/black * fixup: DIRECTORY.md
This commit is contained in:
committed by
Christian Clauss
parent
5df8aec66c
commit
ea9bf0a90c
25
.github/workflows/directory_writer.yml
vendored
Normal file
25
.github/workflows/directory_writer.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# The objective of this GitHub Action is to add a new DIRECTORY.md file to a pull request if needed.
|
||||
name: directory_writer
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
python-version: [3.7]
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Update DIRECTORY.md
|
||||
run: |
|
||||
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
|
||||
git config --global user.name 'directory_writer'
|
||||
git config --global user.email 'mrvnmchm@users.noreply.github.com'
|
||||
git remote set-url origin https://x-access-token:${{ secrets.gh_token }}@github.com/$GITHUB_REPOSITORY
|
||||
git checkout $GITHUB_HEAD_REF
|
||||
if git diff-files --quiet; then echo 0; else git commit -am "fixup: DIRECTORY.md" && git push; fi
|
||||
Reference in New Issue
Block a user