-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create pandoc.yml / test / C2DH/journal-of-digital-history-ipynb-pref…
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
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 | sed -e 's/\.ipynb$//') | ||
echo "FIRST_IPYNB_FILE=$FIRST_FILE" >> $GITHUB_ENV | ||
- name: pandoc convertion to docx | ||
uses: docker://pandoc/latex:2.9 | ||
with: | ||
args: --output=${{ env.FIRST_IPYNB_FILE }}.docx ${{ env.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 }} |