run notebooks on coast repo #260
Workflow file for this run
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: Generate and commit unit test contents file. | |
on: pull_request | |
jobs: | |
generate-test-contents: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ 3.8 ] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python ${{ matrix.python-version }} for running python script. | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Generate contents. | |
run: | | |
pip install . | |
mkdir -p example_files | |
python unit_testing/generate_unit_test_contents.py | |
- name: Commit changes | |
run: | | |
git config --global user.name "ContentsBot" | |
git config --global author.name "ContentsBot" | |
git config --global user.email "[email protected]" | |
git config --global author.email "[email protected]" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | |
git checkout $GITHUB_HEAD_REF | |
git pull | |
git diff-index --quiet $GITHUB_HEAD_REF || git commit -am "Commit generated unit test contents." | |
git push origin $GITHUB_HEAD_REF |