Skip to content

Commit a90dc65

Browse files
committed
Add pr-creator workflow
1 parent 6c72d57 commit a90dc65

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/pr-creator.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Create PR from Dev to Default Branch
2+
on:
3+
schedule:
4+
- cron: '30 18 * * 6' # Runs every Saturday at midnight IST (adjust as needed)
5+
6+
jobs:
7+
create-pr:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Create PR
15+
run: |
16+
# Get the default branch name using GitHub API
17+
DEFAULT_BRANCH=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/branches/default" | jq -r .name)
18+
19+
# Create a PR from "dev" to the default branch
20+
PR_URL=$(gh pr create --base "$DEFAULT_BRANCH" --head "dev" --title "Auto-generated PR" --json html_url --jq .html_url)
21+
22+
echo "Created PR: $PR_URL"

0 commit comments

Comments
 (0)