File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
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"
You can’t perform that action at this time.
0 commit comments