Skip to content

Commit

Permalink
Merge pull request #495 from hibare/dev
Browse files Browse the repository at this point in the history
Add pr-creator workflow
  • Loading branch information
hibare authored Oct 22, 2023
2 parents 0e484f6 + 20fc50d commit 4a2c493
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/pr-creator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 "$DEFAULT_BRANCH" --head "dev" --title "Auto-generated PR" --json html_url --jq .html_url)
echo "Created PR: $PR_URL"

0 comments on commit 4a2c493

Please sign in to comment.