diff --git a/.github/workflows/produce-pdf.yml b/.github/workflows/produce-pdf.yml index fbfec71..1651ae8 100644 --- a/.github/workflows/produce-pdf.yml +++ b/.github/workflows/produce-pdf.yml @@ -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: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2236f82..adc256a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 @@ -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: @@ -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