Skip to content

docs: add Built on Stellar x402 facilitator landing page #470

docs: add Built on Stellar x402 facilitator landing page

docs: add Built on Stellar x402 facilitator landing page #470

name: Check Routes Removal
on:
pull_request:
paths:
- 'routes.txt'
jobs:
check-routes-removal:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for routes removal
id: check-removal
run: |
# Get the list of removed lines in routes.txt
ROUTES_DIFF=$(git diff origin/${{ github.base_ref }} ${{ github.sha }} -- routes.txt)
# Count removed lines (excluding diff metadata)
REMOVED_COUNT=$(echo "$ROUTES_DIFF" | { grep -E '^\-[^-]' || true; } | wc -l)
if [ $REMOVED_COUNT -gt 0 ]; then
echo "routes_removed=true" >> $GITHUB_OUTPUT
echo "$ROUTES_DIFF" >> routes.diff
else
echo "routes_removed=false" >> $GITHUB_OUTPUT
fi
- name: Comment on PR (if routes were removed)
if: steps.check-removal.outputs.routes_removed == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs')
const diffContent = fs.readFileSync('routes.diff', 'utf8');
// Convert escaped newlines back for display
const formattedDiff = diffContent.replace(/%0A/g, '\n').replace(/%0D/g, '\r').replace(/%25/g, '%');
const comment = `> [!WARNING]
> This change removes routes. The diff of routes is below. Please verify that these changes to the routes are intentional and that redirects are in place if needed. Redirects can be added to \`nginx/includes/redirects.conf\`.
\`\`\`diff
${formattedDiff}
\`\`\`
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});