Skip to content

Commit

Permalink
maint: rebase workflow (managed by Pulumi)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyv committed Feb 27, 2025
1 parent be21a83 commit be45fff
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This file was added by Pulumi and should not be edited manually.

name: Rebase command

on:
issue_comment:
types: [ created ]

jobs:
rebase:
runs-on: ubuntu-latest
timeout-minutes: 5

# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment
if: github.event.issue.pull_request && github.event.comment.body == '/rebase' && github.event.comment.author_association == 'MEMBER'

permissions:
contents: read
pull-requests: read

steps:
- uses: actions/checkout@v4
with:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
fetch-depth: 0
ssh-key: ${{ secrets.WORKFLOW_DEPLOY_KEY }}
show-progress: false

- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.issue.number }}
# Warning: beware of running any user-injected content from this point on (CWE-829)!

- name: Rebase and push
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
GIT_SEQUENCE_EDITOR=true git rebase --interactive --autosquash origin/master
git push -u origin HEAD --force-with-lease

0 comments on commit be45fff

Please sign in to comment.