Skip to content

CI: Add a comment if a PR touches sysvars #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 23, 2025
42 changes: 42 additions & 0 deletions .github/workflows/sysvar-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Sysvar Auto-Comment

on:
pull_request_target:
types:
- opened
- synchronize
paths:
- 'clock/src/**'
- 'epoch-rewards/src/**'
- 'epoch-schedule/src/**'
- 'fee-calculator/src/**'
- 'last-restart-slot/src/**'
- 'rent/src/**'
- 'slot-hashes/src/**'
- 'slot-history/src/**'
- 'sysvar/src/**'
- 'sysvar-id/src/**'

jobs:
comment:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: PR Comment
run:
gh pr comment $PRNUM --body "$COMMENT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PRNUM: ${{ github.event.pull_request.number }}
COMMENT: "If this PR represents a change to the sysvar layout, please
open a follow-up PR to update the JavaScript client `@solana/sysvars`
([example](https://github.com/anza-xyz/kit/pull/375))

Thank you for keeping the JavaScript clients in sync with the Rust
clients."