directory_writer (#1) (#1549)

* directory_writer

* fixup: Format Python code with psf/black

* fixup: DIRECTORY.md
This commit is contained in:
Marvin M. Michum
2019-11-14 14:27:31 -05:00
committed by Christian Clauss
parent 5df8aec66c
commit ea9bf0a90c
2 changed files with 50 additions and 0 deletions

25
.github/workflows/directory_writer.yml vendored Normal file
View 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