-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (59 loc) · 2.22 KB
/
sync-contract-addresses.yml
File metadata and controls
69 lines (59 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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