From 59db32cc150401e60e10e386fb771a21839f88f4 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 22 Jan 2026 13:56:17 -0500 Subject: [PATCH 1/6] chore: Document special branch protection settings Co-Authored-By: Claude Opus 4.5 --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 58f771d..a15f6d0 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,21 @@ This project is licensed under the MIT License - see the [LICENSE](./LICENSE) fi Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests. +## Repository Maintenance + +### Branch Protection + +This repository has special branch protection settings to support automated deployments: + +- **PR requirement**: All changes require a pull request with 1 approving review +- **GitHub Actions bypass**: The `github-actions` app can push directly to `main` to update timestamps and create version snapshots during deployment + +This configuration is necessary because the deployment workflow (`deploy.yml`) pushes automated commits to `main` when a release is published: +1. Updates the `timestamp` field in `tokens/token-list.json` +2. Creates a historical snapshot in `versions/` + +If org-wide branch protection automation is applied, this repository may need to be excluded to preserve this functionality. + ## Security For security concerns, please submit an issue or contact the Request Network team. From 8d9dd701c9afffbb87218f586339df14650c63df Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 22 Jan 2026 14:08:47 -0500 Subject: [PATCH 2/6] chore: Add required status check to branch protection docs Co-Authored-By: Claude Opus 4.5 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a15f6d0..e0897ad 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of cond This repository has special branch protection settings to support automated deployments: - **PR requirement**: All changes require a pull request with 1 approving review +- **Required status check**: `validate` must pass (only runs when `tokens/`, `src/`, `tests/`, or `package.json` files change) - **GitHub Actions bypass**: The `github-actions` app can push directly to `main` to update timestamps and create version snapshots during deployment This configuration is necessary because the deployment workflow (`deploy.yml`) pushes automated commits to `main` when a release is published: From 78d9def8670242148f80e12d70f35092efffcef9 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 22 Jan 2026 14:11:58 -0500 Subject: [PATCH 3/6] chore: Trigger CI From 3da3f1154a75e0546786590b94a0d72728812d24 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 22 Jan 2026 14:46:06 -0500 Subject: [PATCH 4/6] chore: Remove path filters from PR validation workflow Always run validation on PRs to ensure required status check reports. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/pr.yml | 6 ------ README.md | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fc2cf46..a5ca022 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,12 +3,6 @@ name: PR Validation on: pull_request: branches: [main] - paths: - - "tokens/**" - - "src/**" - - "tests/**" - - "package.json" - - "package-lock.json" jobs: validate: diff --git a/README.md b/README.md index e0897ad..e53fd97 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of cond This repository has special branch protection settings to support automated deployments: - **PR requirement**: All changes require a pull request with 1 approving review -- **Required status check**: `validate` must pass (only runs when `tokens/`, `src/`, `tests/`, or `package.json` files change) +- **Required status check**: `validate` must pass - **GitHub Actions bypass**: The `github-actions` app can push directly to `main` to update timestamps and create version snapshots during deployment This configuration is necessary because the deployment workflow (`deploy.yml`) pushes automated commits to `main` when a release is published: From 8818eb850abd8e22ae78285b807cbbbbc04bdbbe Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 22 Jan 2026 14:49:18 -0500 Subject: [PATCH 5/6] fix: Reset timestamp to placeholder after deployment After deployment, reset the timestamp in token-list.json back to the placeholder value. This ensures future PRs pass validation, since the validation script expects the placeholder (not a real timestamp). The deployed files on GitHub Pages retain the real timestamp. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/deploy.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 226c639..98a6032 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -164,3 +164,15 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist + + - name: Reset timestamp to placeholder + run: | + # Reset timestamp to placeholder so future PRs pass validation + jq '.timestamp = "Set automatically during deployment"' tokens/token-list.json > tokens/token-list.json.tmp + mv tokens/token-list.json.tmp tokens/token-list.json + + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add tokens/token-list.json + HUSKY=0 git commit -m "chore: Reset timestamp to placeholder [skip ci]" + git push origin main From 79a1058bdf617b342604d5e6ee67159658bfaa73 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Thu, 22 Jan 2026 14:53:40 -0500 Subject: [PATCH 6/6] fix: Don't modify source token-list.json during deployment - Deployment now creates timestamped copies in dist/ without modifying the source file - Reset timestamp to placeholder so validation passes on future PRs - Historical snapshots in versions/ still have real timestamps - Reduces commit noise (no more timestamp update commits on every deploy) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/deploy.yml | 120 +++++++++++++---------------------- tokens/token-list.json | 2 +- 2 files changed, 46 insertions(+), 76 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 98a6032..b03ca05 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,7 +8,7 @@ jobs: deploy: runs-on: ubuntu-latest permissions: - contents: write # Required to push commits back to main + contents: write # Required to push historical snapshot to main steps: - uses: actions/checkout@v5 with: @@ -27,83 +27,43 @@ jobs: - name: Validate token list run: npm run validate - - name: Update timestamp + - name: Create dist directory with timestamped copies run: | - # Update timestamp to current UTC time - TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") - jq --arg ts "$TIMESTAMP" '.timestamp = $ts' tokens/token-list.json > tokens/token-list.json.tmp - mv tokens/token-list.json.tmp tokens/token-list.json - - # Commit timestamp update if changed (skip husky hooks in CI) - if ! git diff --quiet tokens/token-list.json; then - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add tokens/token-list.json - HUSKY=0 git commit -m "chore: Update timestamp for release [skip ci]" - git push origin main - fi + mkdir -p dist - - name: Preserve current version as historical snapshot - run: | - # Get the current version being deployed - CURRENT_VERSION=$(jq -r '"\(.version.major).\(.version.minor).\(.version.patch)"' tokens/token-list.json) - - # Check if this version already exists in versions/ - if [ ! -f "versions/v${CURRENT_VERSION}.json" ]; then - mkdir -p versions - cp tokens/token-list.json versions/v${CURRENT_VERSION}.json - echo "Preserved v${CURRENT_VERSION}.json as historical snapshot" - - # Commit the historical snapshot back to main (skip husky hooks in CI) - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add versions/v${CURRENT_VERSION}.json - HUSKY=0 git commit -m "chore: Preserve v${CURRENT_VERSION}.json as historical snapshot [skip ci]" - git push origin main - else - echo "v${CURRENT_VERSION}.json already exists in versions/ directory" - fi + # Get current timestamp + TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") - - name: Create dist directory - run: | - mkdir -p dist - - # Extract version components + # Extract version components from source file VERSION=$(jq -r '"\(.version.major).\(.version.minor).\(.version.patch)"' tokens/token-list.json) MAJOR=$(jq -r '.version.major' tokens/token-list.json) MINOR=$(jq -r '.version.minor' tokens/token-list.json) - - # Copy current version with full version (e.g., v1.1.0.json) - cp tokens/token-list.json dist/v${VERSION}.json - - # Copy with major.minor version (e.g., v1.1.json) - updates automatically - cp tokens/token-list.json dist/v${MAJOR}.${MINOR}.json - - # Copy with major version only (e.g., v1.json) - updates automatically - cp tokens/token-list.json dist/v${MAJOR}.json - - # Copy as latest (always points to newest) - cp tokens/token-list.json dist/latest.json - - # Copy base file - cp tokens/token-list.json dist/token-list.json - + + # Create timestamped version for deployment (source file unchanged) + jq --arg ts "$TIMESTAMP" '.timestamp = $ts' tokens/token-list.json > dist/token-list.json + + # Copy timestamped version to all version aliases + cp dist/token-list.json dist/v${VERSION}.json + cp dist/token-list.json dist/v${MAJOR}.${MINOR}.json + cp dist/token-list.json dist/v${MAJOR}.json + cp dist/token-list.json dist/latest.json + # Copy all historical versions and create major.minor and major aliases if [ -d "versions" ]; then # Declare associative arrays to track highest versions declare -A highest_patch # tracks highest patch for each major.minor declare -A highest_minor # tracks highest minor.patch for each major - + for version_file in versions/*.json; do if [ -f "$version_file" ]; then # Copy the full version file (e.g., v1.2.0.json) cp "$version_file" dist/ - + # Extract version components from the file content FILE_MAJOR=$(jq -r '.version.major' "$version_file") FILE_MINOR=$(jq -r '.version.minor' "$version_file") FILE_PATCH=$(jq -r '.version.patch' "$version_file") - + # Skip if this is the current version's major (already created above) if [ "$FILE_MAJOR" = "$MAJOR" ]; then echo "Skipping major alias v${FILE_MAJOR}.json - current version takes precedence" @@ -113,7 +73,7 @@ jobs: continue fi fi - + # Create/update major.minor alias (e.g., v1.2.json) MINOR_KEY="${FILE_MAJOR}.${FILE_MINOR}" MINOR_ALIAS="v${MINOR_KEY}.json" @@ -123,7 +83,7 @@ jobs: highest_patch[$MINOR_KEY]=$FILE_PATCH echo "Created/updated alias ${MINOR_ALIAS} from $(basename $version_file)" fi - + # Create/update major alias (e.g., v1.json) - only for non-current majors if [ "$FILE_MAJOR" != "$MAJOR" ]; then MAJOR_ALIAS="v${FILE_MAJOR}.json" @@ -141,7 +101,7 @@ jobs: done echo "Copied historical versions and created aliases" fi - + # Create index.html that redirects to latest.json cat > dist/index.html << 'EOF' @@ -156,23 +116,33 @@ jobs: EOF - + echo "Created versioned files: v${VERSION}.json, v${MAJOR}.${MINOR}.json, v${MAJOR}.json, latest.json" + - name: Preserve current version as historical snapshot + run: | + # Get the current version being deployed + CURRENT_VERSION=$(jq -r '"\(.version.major).\(.version.minor).\(.version.patch)"' tokens/token-list.json) + + # Check if this version already exists in versions/ + if [ ! -f "versions/v${CURRENT_VERSION}.json" ]; then + mkdir -p versions + # Use the timestamped version from dist/ for the historical snapshot + cp dist/v${CURRENT_VERSION}.json versions/v${CURRENT_VERSION}.json + echo "Preserved v${CURRENT_VERSION}.json as historical snapshot" + + # Commit the historical snapshot back to main + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add versions/v${CURRENT_VERSION}.json + HUSKY=0 git commit -m "chore: Preserve v${CURRENT_VERSION}.json as historical snapshot [skip ci]" + git push origin main + else + echo "v${CURRENT_VERSION}.json already exists in versions/ directory" + fi + - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist - - - name: Reset timestamp to placeholder - run: | - # Reset timestamp to placeholder so future PRs pass validation - jq '.timestamp = "Set automatically during deployment"' tokens/token-list.json > tokens/token-list.json.tmp - mv tokens/token-list.json.tmp tokens/token-list.json - - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add tokens/token-list.json - HUSKY=0 git commit -m "chore: Reset timestamp to placeholder [skip ci]" - git push origin main diff --git a/tokens/token-list.json b/tokens/token-list.json index 29db377..d44570a 100644 --- a/tokens/token-list.json +++ b/tokens/token-list.json @@ -1,6 +1,6 @@ { "name": "Request Network Token List", - "timestamp": "2026-01-22T18:53:30.000Z", + "timestamp": "Set automatically during deployment", "version": { "major": 1, "minor": 4,