Merge pull request #58 from ZEISS/20240909-feat-md2pdf #16
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: Create Release Notes PDF | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
create_pdf: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install markdown_pdf | |
run: | | |
pip install markdown_pdf | |
- name: Find and Convert Release Notes | |
id: convert_notes | |
run: | | |
pwd | |
find . -type f -name 'Releasenotes.md' -exec sh -c ' | |
basepath=$(dirname "{}") # Get the folder path | |
echo $basepath | |
if [ ! -f "$basepath/Releasenotes.pdf" ]; then | |
python .github/scripts/md2pdf.py "{}" "$basepath/Releasenotes.pdf" | |
git config --global user.name "GitHub Action" | |
git config --global user.email "action@github.com" | |
git add "$basepath/Releasenotes.pdf" | |
git commit -m "Add Releasenotes.pdf" | |
git push origin ${GITHUB_REF#refs/*/} | |
fi | |
' \; |