Skip to content

docs(wallets): add Tenderly debugging documentation page #1278

docs(wallets): add Tenderly debugging documentation page

docs(wallets): add Tenderly debugging documentation page #1278

Workflow file for this run

name: Run checks on PR
on: pull_request
jobs:
open-api-specs:
name: OpenAPI Specs
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm
- name: Validate REST API specs
run: pnpm run generate:rest
rpc-specs:
name: JSON-RPC Specs
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm
- name: Validate RPC specs
run: pnpm run generate:rpc
lint:
name: Lint Files
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm
- name: Run ESLint
run: pnpm run lint:eslint
generate-preview:
name: Generate Preview
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Preview
id: generate-preview
uses: ./.github/actions/generate-preview
with:
github-token: ${{ github.token }}
branch: ${{ github.head_ref }}
kv-rest-api-url: ${{ secrets.KV_REST_API_URL }}
kv-rest-api-token: ${{ secrets.KV_REST_API_TOKEN }}
docs-site-url: ${{ secrets.DOCS_SITE_URL }}
docs-site-api-key: ${{ secrets.DOCS_SITE_API_KEY }}
link-check:
name: Link Check
runs-on: ubuntu-latest
# generate-preview uploads branch-scoped preview content to Redis.
# If link-check runs before that upload completes, it can validate against stale/main data.
needs: generate-preview
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect content changes
id: changed-files
shell: bash
run: |
set +e
CHANGED_FILES=$(git diff --name-only \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}" \
-- 'content/**/*.md' 'content/**/*.mdx')
EXIT_CODE=$?
set -e
if [ $EXIT_CODE -ne 0 ]; then
echo "::error::git diff failed with exit code $EXIT_CODE"
exit 1
fi
if [ -z "$CHANGED_FILES" ]; then
echo "No content markdown files changed. Skipping lychee."
echo "has-content-changes=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "Changed markdown files:"
echo "$CHANGED_FILES"
echo "has-content-changes=true" >> "$GITHUB_OUTPUT"
- name: Build signed preview URL
if: steps.changed-files.outputs.has-content-changes == 'true'
id: preview_url
shell: bash
env:
DOCS_SITE_URL: ${{ secrets.DOCS_SITE_URL }}
DOCS_SITE_API_KEY: ${{ secrets.DOCS_SITE_API_KEY }}
BRANCH: ${{ github.head_ref }}
run: |
set -euo pipefail
PREVIEW_URL=$(node <<'NODE'
const crypto = require("crypto");
const base = process.env.DOCS_SITE_URL;
const branch = process.env.BRANCH;
const secret = process.env.DOCS_SITE_API_KEY;
const sig = crypto.createHmac("sha256", secret).update(branch).digest("hex");
process.stdout.write(
`${base}/api/preview/start?branch=${encodeURIComponent(branch)}&sig=${sig}`,
);
NODE
)
echo "preview_url=$PREVIEW_URL" >> "$GITHUB_OUTPUT"
- name: Bootstrap preview cookies
if: steps.changed-files.outputs.has-content-changes == 'true'
# Cookie priming step only: this warms lychee's JSON cookie jar with
# docs-site draft-mode cookies from the signed preview URL.
# The real link validation happens in the next "Link Checker" step.
uses: lycheeverse/lychee-action@v2
with:
args: '--no-progress --cookie-jar ./.artifacts/lychee-cookies.json "${{ steps.preview_url.outputs.preview_url }}"'
fail: false
- name: Link Checker
if: steps.changed-files.outputs.has-content-changes == 'true'
id: lychee
uses: lycheeverse/lychee-action@v2
with:
format: json
output: ./broken-links.json
args: '--config ./lychee.toml --base-url "${{ secrets.DOCS_SITE_URL }}" --no-progress --cookie-jar ./.artifacts/lychee-cookies.json ./content'
fail: true
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Post link check comment
if: always()
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
const fs = require("fs");
const workspace = process.env.GITHUB_WORKSPACE;
const { updateLinkCheckComment } = await import(`${workspace}/scripts/link-check-comment.js`);
const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
const jobs = await github.paginate(
github.rest.actions.listJobsForWorkflowRun,
{
owner: context.repo.owner,
repo: context.repo.repo,
run_id: Number(process.env.GITHUB_RUN_ID),
per_page: 100,
},
);
const currentJob = jobs.find((job) => job.name === "Link Check");
const jobUrl = currentJob?.html_url ?? runUrl;
const hasContentChanges = '${{ steps.changed-files.outputs.has-content-changes }}' === 'true';
const lycheeStatus = '${{ steps.lychee.outcome }}' || 'skipped';
const reportPath = `${workspace}/broken-links.json`;
const reportJsonContent = fs.existsSync(reportPath)
? fs.readFileSync(reportPath, "utf8")
: "";
await updateLinkCheckComment({
github,
context,
hasContentChanges,
lycheeStatus,
reportJsonContent,
runUrl: jobUrl,
});