Skip to content

Commit

Permalink
chore: update typo PR script (#5488)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

This PR updates the typo PR script to squash the commits as multi-commit
PRs weren't being processed properly.

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
TomAFrench authored Jul 12, 2024
1 parent 0541568 commit f459257
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/redo-typo-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@ gh pr checkout $ORIGINAL_PR_NUMBER
echo "Creating new local branch $NEW_BRANCH"
git checkout -b $NEW_BRANCH

# Step 3: Push the new branch to GitHub
# Step 3: Squash commits
echo "Squashing new local branch $NEW_BRANCH"
git reset --soft master
git add .
git commit -m "chore: typo fixes"

# Step 4: Push the new branch to GitHub
echo "Pushing new branch $NEW_BRANCH to GitHub"
git commit --amend --no-edit
git push origin $NEW_BRANCH

# Step 4: create a new pull request
# Step 5: create a new pull request
echo "Creating a new pull request for $NEW_BRANCH"
gh pr create --base master --head $NEW_BRANCH --title "chore: redo typo PR by $AUTHOR" --body "Thanks $AUTHOR for https://github.com/$REPO/pull/$ORIGINAL_PR_NUMBER. Our policy is to redo typo changes to dissuade metric farming. This is an automated script."

# Step 5: Close the original PR
# Step 6: Close the original PR
echo "Closing original PR #$ORIGINAL_PR_NUMBER"
gh pr close $ORIGINAL_PR_NUMBER

Expand Down

0 comments on commit f459257

Please sign in to comment.