Skip to content

Commit

Permalink
Fix workflow (#15)
Browse files Browse the repository at this point in the history
* fixing workflow

* Fixing workflow

* Added debug

* Add debug for ghostscript workaround

* Workaround ghostscript vunerablilty protection

* Add sudo

* Another inline sed

* Cat polixy.xml

* Install ghostscript

* Add sudo

* Moved fixes to produce workflow

* Changed wording

---------

Co-authored-by: Rob Brown <[email protected]>
  • Loading branch information
robert-will-brown and Rob Brown authored Apr 11, 2024
1 parent 2b1f17f commit 4d7392b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/produce-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:
- name: Generate Thumbnail for Page 1
uses: jruipinto/ImageMagick-action@v1
with:
command: convert -density 700 -resize 10% -append -quality 98 -alpha remove rb-cv.pdf[0] rb-cv-thumbnail-p1.jpg
command: |
sudo sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
convert -density 700 -resize 10% -append -quality 98 -alpha remove rb-cv.pdf[0] rb-cv-thumbnail-p1.jpg
- name: Generate Thumbnail for Page 2
uses: jruipinto/ImageMagick-action@v1
with:
Expand Down
30 changes: 26 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Tests
name: Test
on: [pull_request, workflow_dispatch]
jobs:

spelling:
name: Spell Check
name: Spelling is correct
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
Expand All @@ -15,7 +15,7 @@ jobs:
shell: bash --noprofile --norc -eo pipefail -o nounset {0}

build_pdf:
name: Create Test PDF
name: Can create PDF
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
path: ./rb-cv.pdf

two_pages:
name: Check Num Pages
name: Is less than three pages
needs: build_pdf
runs-on: ubuntu-latest
steps:
Expand All @@ -62,3 +62,25 @@ jobs:
- name: Length of Document Check
run: cicd/Length.sh
shell: bash --noprofile --norc -eo pipefail -o nounset {0}

can_create_thumbnail:
name: Can create thumbnail
needs: build_pdf
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: rb-cv.pdf
path: ./
- name: install ghostscript
run: sudo apt install ghostscript -y
- name: Workaround ghostscript vunerability protection
# A vunerabillty that existed in ghostscript no longer exists. This is to work around the temporary protection
# that was put in place.
# https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion
run: sudo sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
- name: Run convert command
run: convert -density 700 -resize 10% -append -quality 98 -alpha remove rb-cv.pdf rb-cv-thumbnail-p1.jpg

0 comments on commit 4d7392b

Please sign in to comment.