From 6d016be3e35d81025c5283ec6e60cb07315744f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:34:11 +0000 Subject: [PATCH 1/4] build(deps): bump actions/create-github-app-token from 2.2.2 to 3.3.0 Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2.2.2 to 3.3.0. - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Changelog](https://github.com/actions/create-github-app-token/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/create-github-app-token/compare/fee1f7d63c2ff003460e3d139729b119787bc349...64ab729a6294000f5aa4a4bc0b73d1f32bc45510) --- updated-dependencies: - dependency-name: actions/create-github-app-token dependency-version: 3.3.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/preview-fork-deploy.yml | 2 +- .github/workflows/preview-remove.yml | 2 +- .github/workflows/preview.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview-fork-deploy.yml b/.github/workflows/preview-fork-deploy.yml index 1453a8da..31b516e0 100644 --- a/.github/workflows/preview-fork-deploy.yml +++ b/.github/workflows/preview-fork-deploy.yml @@ -46,7 +46,7 @@ jobs: - name: Create scoped Pages deployment token id: preview-token - uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 with: app-id: ${{ vars.LIBRECODE_WORKFLOW_APP_ID }} private-key: ${{ secrets.LIBRECODE_WORKFLOW_APP_PRIVATE_KEY }} diff --git a/.github/workflows/preview-remove.yml b/.github/workflows/preview-remove.yml index 4b8ffad9..e22a6027 100644 --- a/.github/workflows/preview-remove.yml +++ b/.github/workflows/preview-remove.yml @@ -33,7 +33,7 @@ jobs: - name: Create scoped cleanup token id: preview-token - uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 with: app-id: ${{ vars.LIBRECODE_WORKFLOW_APP_ID }} private-key: ${{ secrets.LIBRECODE_WORKFLOW_APP_PRIVATE_KEY }} diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 7ab97894..0ad712fd 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -70,7 +70,7 @@ jobs: - name: Create scoped preview deployment token if: github.event.pull_request.head.repo.full_name == github.repository id: preview-token - uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 with: app-id: ${{ vars.LIBRECODE_WORKFLOW_APP_ID }} private-key: ${{ secrets.LIBRECODE_WORKFLOW_APP_PRIVATE_KEY }} From 509e12d416ed08d09f579d16bb0a5f66b8bb1a2a Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Wed, 11 Nov 2026 22:54:58 +0000 Subject: [PATCH 2/4] fix(ci): avoid using preview deploy secrets in Dependabot PR runs Dependabot-triggered pull_request workflows lack Actions secrets. Upload an unprivileged HTML preview artifact rather than invoking the GitHub App token action with an empty private key; trusted internal PRs still use the scoped deployment flow. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .github/workflows/preview.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 0ad712fd..82428947 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -58,7 +58,7 @@ jobs: --site _publish --preview-root "$PREVIEW_ROOT" - name: Upload unprivileged preview for fork PRs - if: github.event.pull_request.head.repo.full_name != github.repository + if: github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' uses: actions/upload-artifact@v4 with: name: documentation-preview-site @@ -68,7 +68,7 @@ jobs: retention-days: 3 - name: Create scoped preview deployment token - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' id: preview-token uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 with: @@ -79,7 +79,7 @@ jobs: permission-contents: write - name: Deploy preview to separate GitHub Pages origin - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' uses: LibreSign/pr-preview-action@2a6da1177b47dc23173ba9a75e01da0a0d800978 with: action: deploy @@ -94,7 +94,7 @@ jobs: token: ${{ steps.preview-token.outputs.token }} - name: Check every navigable preview route on the public origin - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' env: PREVIEW_ROOT: https://libresign.github.io/site-preview/docs-preview/pr-${{ github.event.pull_request.number }} run: | @@ -118,7 +118,7 @@ jobs: done < _publish/_review/routes.txt - name: Comment with navigable preview links - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.pull_request.number }} From fa097c092671ead0907f6ad90e8777fcb3c097bc Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Thu, 12 Nov 2026 02:00:13 +0000 Subject: [PATCH 3/4] build(ci): reconcile Dependabot action update with current preview workflows Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .github/workflows/preview-fork-deploy.yml | 4 +- .github/workflows/preview.yml | 86 ++++++++++++++++++----- 2 files changed, 71 insertions(+), 19 deletions(-) diff --git a/.github/workflows/preview-fork-deploy.yml b/.github/workflows/preview-fork-deploy.yml index 31b516e0..3d490a83 100644 --- a/.github/workflows/preview-fork-deploy.yml +++ b/.github/workflows/preview-fork-deploy.yml @@ -28,7 +28,7 @@ jobs: cancel-in-progress: false steps: - name: Download validated preview HTML - uses: actions/download-artifact@v4 + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GITHUB_TOKEN }} @@ -65,7 +65,7 @@ jobs: preview-branch: gh-pages pages-base-url: libresign.github.io/site-preview wait-for-pages-deployment: true - qr-code: false + qr-code: true token: ${{ steps.preview-token.outputs.token }} - name: Verify navigable public preview diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 82428947..71e76a12 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -48,7 +48,7 @@ jobs: python -m versioning.verify --output _build python -m versioning.publish --built _build --destination _publish python -m versioning.verify --output _publish - rm _publish/CNAME + rm _publish/CNAME _publish/.nojekyll - name: Render navigable HTML for unpublished release documentation env: @@ -58,8 +58,8 @@ jobs: --site _publish --preview-root "$PREVIEW_ROOT" - name: Upload unprivileged preview for fork PRs - if: github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' - uses: actions/upload-artifact@v4 + if: github.event.pull_request.head.repo.full_name != github.repository + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: documentation-preview-site path: _publish/ @@ -68,7 +68,7 @@ jobs: retention-days: 3 - name: Create scoped preview deployment token - if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' + if: github.event.pull_request.head.repo.full_name == github.repository id: preview-token uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 with: @@ -79,7 +79,8 @@ jobs: permission-contents: write - name: Deploy preview to separate GitHub Pages origin - if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' + id: preview-deploy + if: github.event.pull_request.head.repo.full_name == github.repository uses: LibreSign/pr-preview-action@2a6da1177b47dc23173ba9a75e01da0a0d800978 with: action: deploy @@ -89,45 +90,96 @@ jobs: deploy-repository: LibreSign/site-preview preview-branch: gh-pages pages-base-url: libresign.github.io/site-preview - wait-for-pages-deployment: true - qr-code: true + # A newer deployment from another PR can supersede this Pages build. + # Verify our published revision over HTTP instead of waiting on its run ID. + wait-for-pages-deployment: false + comment: false + qr-code: false token: ${{ steps.preview-token.outputs.token }} + - name: Wait until GitHub Pages serves this exact preview revision + if: github.event.pull_request.head.repo.full_name == github.repository + env: + PREVIEW_ROOT: https://libresign.github.io/site-preview/docs-preview/pr-${{ github.event.pull_request.number }} + run: | + # The deploy action pushes gh-pages, but Pages publishes it + # asynchronously. Byte equality of versions.json proves the + # exact documentation revision has reached the public origin. + for attempt in $(seq 1 108); do + if curl -fsSL --max-time 15 -H 'Cache-Control: no-cache' \ + -o /tmp/libresign-live-versions.json \ + "$PREVIEW_ROOT/versions.json?run=$GITHUB_RUN_ID&attempt=$attempt" && + cmp -s _publish/versions.json /tmp/libresign-live-versions.json; then + echo "GitHub Pages serves the expected documentation revision" + break + fi + if [ "$attempt" -eq 108 ]; then + echo "::error::GitHub Pages did not publish this preview revision" >&2 + exit 1 + fi + sleep 10 + done + - name: Check every navigable preview route on the public origin - if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' + if: github.event.pull_request.head.repo.full_name == github.repository env: PREVIEW_ROOT: https://libresign.github.io/site-preview/docs-preview/pr-${{ github.event.pull_request.number }} run: | - while IFS= read -r route; do + # GitHub Pages is shared with other PR previews. Its deployment run + # can be superseded even when this preview's HTML is publicly served. + # Compare rendered pages with the public origin instead of a specific + # Pages run or PR merge SHA. + { + cat _publish/_review/routes.txt + find _publish -type f -name '*.html' -printf '/%P\n' + printf '%s\n' '/home.css' '/ecosystem-nav.css' '/ecosystem-nav.js' '/scroll-navigation.js' '/home-theme.js' '/versions.json' + } | sort -u | while IFS= read -r route; do [ -n "$route" ] || continue + local_page="_publish$route" + if [[ "$route" == */ ]]; then + local_page="${local_page}index.html" + fi + if [ ! -f "$local_page" ]; then + echo "::error::Missing generated preview page: $local_page" >&2 + exit 1 + fi url="$PREVIEW_ROOT$route" success=false - for attempt in $(seq 1 24); do - if curl -fsSL --max-time 15 -o /tmp/libresign-preview-page.html "$url" && - grep -Eq 'libresign-version-toggle|Documentation by release|Preview-only documentation' /tmp/libresign-preview-page.html; then - echo "Public preview available: $url" + for attempt in $(seq 1 4); do + if curl -fsSL --max-time 15 -H 'Cache-Control: no-cache' \ + -o /tmp/libresign-preview-page.html \ + "$url?run=$GITHUB_RUN_ID&attempt=$attempt" && + cmp -s "$local_page" /tmp/libresign-preview-page.html; then + echo "Published preview matches generated content: $url" success=true break fi sleep 5 done if [ "$success" != true ]; then - echo "::error::Preview page unavailable: $url" >&2 + echo "::error::Public preview missing or stale: $url" >&2 exit 1 fi - done < _publish/_review/routes.txt + done - name: Comment with navigable preview links - if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' + if: github.event.pull_request.head.repo.full_name == github.repository env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.pull_request.number }} + PREVIEW_ROOT: https://libresign.github.io/site-preview/docs-preview/pr-${{ github.event.pull_request.number }} + ACTION_VERSION: ${{ steps.preview-deploy.outputs.action-version }} + ACTION_START_TIME: ${{ steps.preview-deploy.outputs.action-start-time }} run: | + python -m versioning.pr_preview \ + --site _publish --preview-root "$PREVIEW_ROOT" \ + --action-version "$ACTION_VERSION" --built-at "$ACTION_START_TIME" body=$(cat _publish/_review/preview-comment.md) marker='' legacy='' + native='' comment_id=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments?per_page=100" \ - --paginate --jq ".[] | select(.body | contains(\"$marker\") or contains(\"$legacy\")) | .id" | head -n 1) + --paginate --jq ".[] | select(.body | contains(\"$marker\") or contains(\"$legacy\") or contains(\"$native\")) | .id" | head -n 1) if [ -n "$comment_id" ]; then gh api --method PATCH "repos/$GITHUB_REPOSITORY/issues/comments/$comment_id" \ -f body="$body" >/dev/null From 34611fbcc92acdc8237da9cd06049248efe0285b Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Thu, 12 Nov 2026 02:00:55 +0000 Subject: [PATCH 4/4] fix(ci): route Dependabot previews through existing trusted publisher Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .github/workflows/preview-fork-deploy.yml | 3 ++- .github/workflows/preview.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/preview-fork-deploy.yml b/.github/workflows/preview-fork-deploy.yml index 3d490a83..1412b471 100644 --- a/.github/workflows/preview-fork-deploy.yml +++ b/.github/workflows/preview-fork-deploy.yml @@ -20,7 +20,8 @@ jobs: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.pull_requests[0].number > 0 && - github.event.workflow_run.head_repository.id != github.event.repository.id + (github.event.workflow_run.head_repository.id != github.event.repository.id || + startsWith(github.event.workflow_run.head_branch, 'dependabot/')) runs-on: ubuntu-latest timeout-minutes: 15 concurrency: diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 71e76a12..cd9eaacc 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -58,7 +58,7 @@ jobs: --site _publish --preview-root "$PREVIEW_ROOT" - name: Upload unprivileged preview for fork PRs - if: github.event.pull_request.head.repo.full_name != github.repository + if: github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.login == 'dependabot[bot]' uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: documentation-preview-site @@ -68,7 +68,7 @@ jobs: retention-days: 3 - name: Create scoped preview deployment token - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]' id: preview-token uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 with: @@ -80,7 +80,7 @@ jobs: - name: Deploy preview to separate GitHub Pages origin id: preview-deploy - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]' uses: LibreSign/pr-preview-action@2a6da1177b47dc23173ba9a75e01da0a0d800978 with: action: deploy @@ -98,7 +98,7 @@ jobs: token: ${{ steps.preview-token.outputs.token }} - name: Wait until GitHub Pages serves this exact preview revision - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]' env: PREVIEW_ROOT: https://libresign.github.io/site-preview/docs-preview/pr-${{ github.event.pull_request.number }} run: | @@ -121,7 +121,7 @@ jobs: done - name: Check every navigable preview route on the public origin - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]' env: PREVIEW_ROOT: https://libresign.github.io/site-preview/docs-preview/pr-${{ github.event.pull_request.number }} run: | @@ -163,7 +163,7 @@ jobs: done - name: Comment with navigable preview links - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]' env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.pull_request.number }}