Sync Contract Addresses #43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync Contract Addresses | |
| on: | |
| schedule: | |
| # Run daily at midnight UTC | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| # Allow manual triggers | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| sync-contract-addresses: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check for differences | |
| id: check | |
| run: | | |
| if npx tsx scripts/sync-contract-addresses.ts --check; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Sync contract addresses | |
| if: steps.check.outputs.changed == 'true' | |
| run: npx tsx scripts/sync-contract-addresses.ts | |
| - name: Create Pull Request | |
| if: steps.check.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "chore: sync contract addresses from upstream" | |
| title: "chore: sync contract addresses from upstream" | |
| body: | | |
| Contract addresses have been updated from the upstream [deployments.json](https://github.com/FilOzone/filecoin-services/blob/main/service_contracts/deployments.json). | |
| This PR was automatically generated by the [Sync Contract Addresses](${{ github.server_url }}/${{ github.repository }}/actions/workflows/sync-contract-addresses.yml) workflow. | |
| branch: chore/sync-contract-addresses | |
| base: main | |
| delete-branch: true | |
| labels: | | |
| automated | |
| contracts | |
| - name: Summary | |
| run: | | |
| if [ "${{ steps.check.outputs.changed }}" == "true" ]; then | |
| echo "## ✅ Contract addresses updated" >> $GITHUB_STEP_SUMMARY | |
| echo "A pull request has been created/updated." >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "## ✅ Contract addresses are in sync" >> $GITHUB_STEP_SUMMARY | |
| echo "No changes needed." >> $GITHUB_STEP_SUMMARY | |
| fi |