generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (34 loc) · 1.21 KB
/
sync-program-examples.yml
File metadata and controls
40 lines (34 loc) · 1.21 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
name: Sync Program Examples
on:
repository_dispatch: # Triggered from program-examples repo
types: [sync-examples]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout docs repo
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Pull latest changes from program-examples
run: |
cd .context/program-examples
git fetch origin main
git reset --hard origin/main
- name: Check for changes
id: check_changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push if changes
if: steps.check_changes.outputs.changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .context/program-examples
git commit -m "chore: sync program-examples from upstream
Synced with Lightprotocol/program-examples@$(cd .context/program-examples && git rev-parse --short HEAD)"
git push