-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (49 loc) · 1.7 KB
/
update-submodule.yml
File metadata and controls
55 lines (49 loc) · 1.7 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
name: Update submodule pointer
on:
repository_dispatch:
types: [submodule-updated]
workflow_dispatch:
concurrency:
group: update-submodule
cancel-in-progress: true
jobs:
update-submodule:
runs-on: ubuntu-latest
steps:
- name: Checkout dev branch
uses: actions/checkout@v4
with:
ref: dev
submodules: true
# Use default GITHUB_TOKEN — has push access to the repo
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update submodule to latest dev
run: |
cd plugins/temporal-developer/skills/temporal-developer
git fetch origin dev
git checkout FETCH_HEAD
cd "$GITHUB_WORKSPACE"
- name: Check for changes
id: check
run: |
if git diff --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Create PR and merge
if: steps.check.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
branch="auto/update-submodule-$(date +%s)"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b "$branch"
git add plugins/temporal-developer/skills/temporal-developer
git commit -m "update submodule to latest dev"
git push origin "$branch"
pr_url=$(gh pr create --base dev --head "$branch" \
--title "update submodule to latest dev" \
--body "Automated submodule pointer update.")
gh pr merge "$pr_url" --squash --auto --delete-branch