GitHub Actions Ipynb for preflight #111
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
on: [workflow_dispatch] | |
name: GitHub Actions Ipynb for preflight | |
jobs: | |
preflight: | |
runs-on: ubuntu-latest | |
name: Ipynb for preflight | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
- name: Extract branch name | |
shell: bash | |
run: echo "GitHub ref_name ${{ github.ref_name }}" | |
id: extract_branch | |
# - name: preflight | |
# id: preflight | |
# uses: c2dh/journal-of-digital-history-ipynb-preflight-action@nbconvert | |
# with: | |
# notebook: 'example/plotly.ipynb' | |
# functions: 'checkkernel,checkcitation,checkhtml,checkoutput,checktags,checkurls,checkjavascript' | |
# output_md: 'report.md' | |
- name: nbconvert run | |
run: | | |
pip install -r requirements.txt | |
python -m pip install jupyter nbconvert nbformat | |
python -m spacy download en_core_web_lg | |
jupyter nbconvert --execute --to notebook --inplace --ExecutePreprocessor.timeout=-1 checkmd.ipynb | |
# Use the output from the `preflight` step | |
- name: Use the output | |
run: echo "Notebook path ${{ steps.preflight.outputs.notebook_path }} - workspace ${{ steps.preflight.outputs.workspace }}" | |
- name: commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
file_pattern: '*.md' | |
- name: create pull request | |
run: gh pr create -B "master" -H "nbconvert" --title 'Merge nbconvert into master' --body 'Created by Github action' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run shell cmd | |
run: echo "Preflight check on https://github.com/${{github.repository}}/blob/${{github.ref_name}}/${{steps.preflight.outputs.notebook}}" | |