test 2 #3
This file contains hidden or 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: Convert PDF to PNG | |
| on: | |
| push: | |
| paths: | |
| - "**/*.pdf" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v2 | |
| - name: Install Ghostscript | |
| run: sudo apt install ghostscript -y | |
| - name: Change ImageMagick Security Policy | |
| run: | | |
| DQT='"' | |
| SRC="rights=${DQT}none${DQT} pattern=${DQT}PDF${DQT}" | |
| RPL="rights=${DQT}read|write${DQT} pattern=${DQT}PDF${DQT}" | |
| sudo sed -i "s/$SRC/$RPL/" /etc/ImageMagick-6/policy.xml || echo "Policy not found, skipping." | |
| - name: Convert PDF to PNG | |
| run: | | |
| convert -density 900 -background white -alpha off Twenty-Seconds-Icons_cv.pdf -quality 90 Twenty-Seconds-Icons_cv.png | |
| - name: Commit PNG | |
| id: commit | |
| run: | | |
| git config --local user.email "action[bot]@github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add Twenty-Seconds-Icons_cv.png | |
| if [ -z "$(git status --porcelain)" ]; then | |
| echo "::set-output name=push::false" | |
| else | |
| git commit -m "[bot] updated Twenty-Seconds-Icons_cv.png" | |
| echo "::set-output name=push::true" | |
| fi | |
| shell: bash | |
| - name: Push Commit | |
| if: steps.commit.outputs.push == 'true' | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.SECRET_TOKEN }} |