Skip to content

Commit

Permalink
add automated PR creation
Browse files Browse the repository at this point in the history
  • Loading branch information
zmraul committed Dec 4, 2024
1 parent 6705edd commit 10e253d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/clone-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
clone-pr:
if: "!startsWith(github.event.pull_request.head.ref, '24.04-cloned')" # Skip if branch starts with "24.04-cloned"
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -37,3 +38,13 @@ jobs:
git add .
git commit -m "switch to 24.04"
git push origin $NEW_BRANCH
- name: Create a pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BASE_BRANCH="${{ github.event.pull_request.base.ref }}"
NEW_BRANCH="24.04-cloned-${{ github.event.pull_request.number }}"
PR_TITLE="Automated PR: 24.04 Changes from ${NEW_BRANCH}"
PR_BODY="This pull request was created automatically. Will test 24.04 base on the charm."
gh pr create --title "$PR_TITLE" --body "$PR_BODY" --head "$NEW_BRANCH" --base "$BASE_BRANCH" --repo "${{ github.repository }}"

0 comments on commit 10e253d

Please sign in to comment.