Skip to content

update devcontainer.json to use GitHub Container Registry instead of Docker Hub for image source and build command [gitHub-PSA]: This commit updates the devcontainer.json file to use GitHub Container Registry for the image source and build command, instead of Docker Hub. This change is likely being made to improve the security and reliability of the container image by using a private registry. #174

update devcontainer.json to use GitHub Container Registry instead of Docker Hub for image source and build command [gitHub-PSA]: This commit updates the devcontainer.json file to use GitHub Container Registry for the image source and build command, instead of Docker Hub. This change is likely being made to improve the security and reliability of the container image by using a private registry.

update devcontainer.json to use GitHub Container Registry instead of Docker Hub for image source and build command [gitHub-PSA]: This commit updates the devcontainer.json file to use GitHub Container Registry for the image source and build command, instead of Docker Hub. This change is likely being made to improve the security and reliability of the container image by using a private registry. #174

Workflow file for this run

---
name: screenshots
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
paths:
- "docs/img/screenshots/*"
- ".github/workflows/screenshots.yml"
- "screenshots.json"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
permissions:
id-token: write
contents: write
pull-requests: write
actions: write
jobs:
configure:
if: ${{ ! contains('
release-please
dependabot
', github.head_ref)
}}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Set matrix data
id: set-matrix
run: echo "matrix=$(jq -c . < ./screenshots.json)" >> $GITHUB_OUTPUT
screenshots:
name: screenshots
if: ${{ ! contains('
release-please
dependabot
', github.head_ref)
}}
needs: configure
strategy:
fail-fast: false
max-parallel: 1
matrix: ${{ fromJson(needs.configure.outputs.matrix) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- uses: browser-actions/setup-chrome@97349de5c98094d4fc9412f31c524d7697115ad8
if: ${{ matrix.url != '' }}
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
if: ${{ matrix.url != '' }}
- name: Install dependencies
if: ${{ matrix.url != '' }}
run: |
npm i puppeteer
- name: take-screenshot
if: ${{ matrix.url != '' }}
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3
with:
run: |
node puppeteer.js ${{ matrix.url }} ./docs/img/screenshots/${{ matrix.filename }}
- name: overlay-arrow
run: |
composite -geometry ${{ matrix.geometry }} docs/img/overlays/pointer-${{ matrix.pointerangle }}.png docs/img/screenshots/${{ matrix.filename }} docs/img/${{ matrix.filename }}
- name: rounded-corners
run: |
size=$(identify -format "%[fx:w]x%[fx:h]" "docs/img/${{ matrix.filename }}")
width=$(echo $size | cut -d'x' -f1)
height=$(echo $size | cut -d'x' -f2)
convert -size $size xc:none -draw "roundrectangle 0,0,$width,$height,10,10" png:- | convert docs/img/${{ matrix.filename }} -matte - -compose DstIn -composite output.png
mv output.png docs/img/${{ matrix.filename }}
- name: add-border
run: |
convert docs/img/${{ matrix.filename }} \
-bordercolor none -border 20 \
\( -clone 0 -fill black -colorize 100 \) \
\( -clone 0 -alpha extract -write mpr:alpha -morphology edgeout disk:1 \) \
-alpha off -compose over -composite \
\( mpr:alpha -morphology dilate disk:1 \) \
-alpha off -compose copy_opacity -composite \
output.png
mv output.png docs/img/${{ matrix.filename }}
- name: drop-shadow
run: |
convert docs/img/${{ matrix.filename }} \( +clone -background black -shadow 30x35+0+18 \) \
+swap \
-background none \
-layers merge \
+repage \
output.png
convert output.png -bordercolor none -border 18 output2.png
mv output2.png docs/img/${{ matrix.filename }}
rm output.png
- name: Push changes
env:
BRANCH: ${{github.event.pull_request.head.ref}}
run: |
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
git add .
git commit -m "docs(${{ matrix.filename }}): processing screenshot"
git config pull.rebase false
git pull
git push --force-with-lease