Skip to content

Commit

Permalink
fix: use temporary branches for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHulme committed Oct 28, 2024
1 parent 6c736d3 commit 835c175
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ name: Release
on:
push:
branches:
- develop
- test-develop
- sh51/create-release-pr
jobs:
pull_request:
name: Create or update PR
Expand All @@ -25,8 +26,8 @@ jobs:
env:
GH_TOKEN: ${{ github.token }} # required for gh cli
run: |
# Extract numbers from PRs that have been merged into develop
PR_NUMBERS=$(gh api repos/:owner/:repo/compare/$MAIN_BRANCH_NAME...develop --jq '
# Extract numbers from PRs that have been merged into test-develop
PR_NUMBERS=$(gh api repos/:owner/:repo/compare/$MAIN_BRANCH_NAME...test-develop --jq '
.commits[]
| select(.commit.message
| startswith("Merge pull request"))
Expand Down Expand Up @@ -67,10 +68,10 @@ jobs:
This PR was auto-generated on $(TZ=Europe/London date --iso-8601=seconds)"
# Check if a PR already exists
EXISTING_PR=$(gh pr list --base "$MAIN_BRANCH_NAME" --head develop --json number --jq '.[0].number')
EXISTING_PR=$(gh pr list --base "$MAIN_BRANCH_NAME" --head test-develop --json number --jq '.[0].number')
if [ -z "$EXISTING_PR" ]; then
gh pr create --base "$MAIN_BRANCH_NAME" --head develop --title "$PR_TITLE" --body "$PR_BODY" --draft
gh pr create --base "$MAIN_BRANCH_NAME" --head test-develop --title "$PR_TITLE" --body "$PR_BODY" --draft
else
gh pr edit "$EXISTING_PR" --body "$PR_BODY"
fi

0 comments on commit 835c175

Please sign in to comment.