-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 999 Bytes
/
rebaseProd.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
name: Create PR to Update Prod
on:
push:
branches:
- main
jobs:
create-pr:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Create Pull Request to prod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh pr list --base prod --head main --state open --json number | jq -e '. | length > 0'; then
echo "PR to update prod from main already exists - skipping creation"
else
body="This pull request updates the \`prod\` branch with the latest changes from the \`main\` branch.
### Make sure to merge this creating a merge commit.
**Do not squash-merge** this PR. **Do not rebase and merge**."
gh pr create --base prod --head main --title "Update prod from main" --body "$body"
fi