Skip to content

Commit 0c47905

Browse files
authored
ci: Add auto-PR (#2509)
1 parent fe52f7a commit 0c47905

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: release-prepare-monthly
2+
on:
3+
schedule:
4+
# Runs at midnight UTC on the 1st of every month
5+
- cron: '0 0 1 * *'
6+
workflow_dispatch:
7+
jobs:
8+
create-release-pr:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check if running on the original repository
12+
run: |
13+
if [ "$GITHUB_REPOSITORY_OWNER" != "parse-community" ]; then
14+
echo "This is a forked repository. Exiting."
15+
exit 1
16+
fi
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Get current branch name
22+
id: branch
23+
run: echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
24+
- name: Generate timestamp
25+
id: timestamp
26+
run: echo "TIMESTAMP=$(date +'%Y%m%d')" >> $GITHUB_ENV
27+
- name: Create new branch
28+
run: |
29+
git checkout -b build/release-${{ env.TIMESTAMP }}
30+
git push origin build/release-${{ env.TIMESTAMP }}
31+
- name: Make empty commit to run CI
32+
run: |
33+
git commit --allow-empty -m "chore: empty commit for release [${{ env.TIMESTAMP }}]"
34+
git push origin build/release-${{ env.TIMESTAMP }}
35+
- name: Create Pull Request
36+
uses: peter-evans/create-pull-request@v6
37+
with:
38+
branch: build/release-${{ env.TIMESTAMP }}
39+
base: release
40+
title: "build: Release"
41+
body: "This is an automated pull request for the monthly release cycle."
42+
draft: false

0 commit comments

Comments
 (0)