-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from hibare/dev
chore(gh): Add PR creator GH workflow
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Create PR from Dev to Default Branch | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '30 18 * * 6' # Runs every Saturday at midnight IST (adjust as needed) | ||
|
||
jobs: | ||
create-pr: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Create PR | ||
run: | | ||
# Get the default branch name using GitHub API | ||
DEFAULT_BRANCH=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/branches/default" | jq -r .name) | ||
# Create a PR from "dev" to the default branch | ||
PR_URL=$(gh pr create --base master --head "dev" --title "Auto-generated PR" -t "Auto-generated PR" -b "Auto-generated PR") | ||
echo "Created PR: $PR_URL" | ||
env: | ||
GH_TOKEN: ${{ github.token }} |