Repository navigation
66 lines (56 loc) · 2.08 KB
/
Copy pathsync-upstream.yml
File metadata and controls
66 lines (56 loc) · 2.08 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
name: Sync with Upstream
on:
schedule:
# Weekly on Monday at 6 AM UTC
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
sync-upstream:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add upstream remote
run: |
git remote add upstream https://github.com/alexandrevilain/temporal-operator.git || true
git fetch upstream
- name: Check for upstream changes
id: check-changes
run: |
# Compare local main with upstream main
LOCAL_SHA=$(git rev-parse HEAD)
UPSTREAM_SHA=$(git rev-parse upstream/main)
if [ "$LOCAL_SHA" = "$UPSTREAM_SHA" ]; then
echo "No changes from upstream"
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "Upstream has changes"
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Merge upstream changes
if: steps.check-changes.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git merge upstream/main --no-edit --allow-unrelated-histories || true
- name: Create Pull Request
if: steps.check-changes.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: sync with upstream temporal-operator"
branch: chore/sync-upstream
delete-branch: true
title: "chore: sync with upstream temporal-operator"
body: |
This PR syncs changes from the upstream repository [alexandrevilain/temporal-operator](https://github.com/alexandrevilain/temporal-operator).
**Automated sync triggered by GitHub Actions.**
Please review the changes carefully before merging.
labels: |
upstream-sync
automated