Skip to content

Commit

Permalink
Update auto-rebase.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
GitGab19 authored Aug 30, 2024
1 parent 2e34b22 commit 778b647
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/auto-rebase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ jobs:
- name: Fetch open pull requests with label
run: |
gh auth setup-git
echo "Fetching open PRs with label 'ready-to-be-merged'"
gh pr list --state open --label "ready-to-be-merged" --json number,headRepositoryOwner,headRefName --jq '.[] | "\(.number) \(.headRepositoryOwner.login) \(.headRefName)"' > pr_details.txt
echo "PRs fetched:"
cat pr_details.txt # Debug: print the content of the file
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}

- name: Rebase pull requests
run: |
echo "Starting rebase process for PRs"
while read pr_number pr_owner pr_branch; do
echo "Processing PR #$pr_number"
echo "Processing PR #$pr_number from $pr_owner/$pr_branch"
# Add the contributor's fork as a remote
git remote add contributor https://github.com/$pr_owner/$(gh repo view --json name -q '.name').git
Expand All @@ -62,7 +66,7 @@ jobs:
# Rebase the branch on top of the main branch
git fetch origin main
if ! git rebase origin/main; then
echo "Conflict detected. Aborting rebase and continuing."
echo "Conflict detected during rebase of PR #$pr_number. Aborting rebase and continuing."
git rebase --abort
# Post a comment on the PR to notify the author about the conflict
Expand Down

0 comments on commit 778b647

Please sign in to comment.