GitHub Actions for pandoc #2
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 for pandoc | |
jobs: | |
pandoc: | |
runs-on: ubuntu-latest | |
name: nbconvert | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
- name: deleting pandoc branch if exists | |
shell: bash | |
run: | | |
git push origin -d pandoc &>/dev/null || true | |
- name: extracting branch name & creating the new pandoc branch | |
shell: bash | |
run: | | |
echo "GitHub reft_name ${{ github.ref_name }}" | |
git checkout -b pandoc | |
git push -u origin pandoc | |
id: extract_branch | |
- name: retreiving name of the article | |
id: getfile | |
run: | | |
FIRST_FILE=$(ls *.ipynb | sort | head -n 1) | |
echo "article name is: $FIRST_FILE" | |
echo "FIRST_IPYNB_FILE=$FIRST_FILE" >> $GITHUB_ENV | |
- uses: docker://pandoc/latex:2.9 | |
with: | |
args: --output=$FIRST_IPYNB_FILE.docx $FIRST_IPYNB_FILE.ipynb | |
- name: committing changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Automated commit | |
branch: pandoc | |
create_branch: true | |
# - name: creating pull request | |
# run: gh pr create -B ${{ github.ref }} -H pandoc --title 'Comparison between nbconvert review of the article and the main article' --body 'Created by Github action' | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |