-
Notifications
You must be signed in to change notification settings - Fork 307
40 lines (36 loc) · 1.35 KB
/
cairo-zero-update-rpc.yml
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
name: cairo-zero Update Submodule
on:
release:
types: [published]
permissions: read-all
jobs:
update-submodule:
# GH_TOKEN is a secret defined in the github repository settings and not the default GITHUB_TOKEN
# This token has write access to the kakarot-rpc repository unlike the default GITHUB_TOKEN
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout Kakarot-RPC Repository
uses: actions/checkout@v4
with:
repository: kkrt-labs/kakarot-rpc
token: ${{ secrets.GH_TOKEN }}
path: kakarot-rpc
- name: Update Submodule
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd kakarot-rpc
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git submodule update --recursive --init
cd lib/kakarot
git fetch --tags
export release_tag=$(git tag --sort=-creatordate | head -n 1)
git checkout $release_tag
cd ../..
git checkout -b kakarot-$release_tag
git add lib/kakarot
git commit -m "Update kakarot to $release_tag"
git push --set-upstream origin kakarot-$release_tag --force
gh pr create --title "Update Kakarot to ${release_tag}" --body "Update Kakarot to ${release_tag}"