From f7a96d7b30865ed0efc89ea352f9659b97188147 Mon Sep 17 00:00:00 2001 From: Mark Elliot <123787712+mark-thm@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:56:08 -0400 Subject: [PATCH] Add autosquash --- .github/workflows/automation-autosquash.yml | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/automation-autosquash.yml diff --git a/.github/workflows/automation-autosquash.yml b/.github/workflows/automation-autosquash.yml new file mode 100644 index 0000000..f1eca5f --- /dev/null +++ b/.github/workflows/automation-autosquash.yml @@ -0,0 +1,36 @@ +name: autosquash +on: + pull_request: + types: + # omit "opened" as labeling happens after opening + # and when we include both the two events end up + # canceling each other's runs. + - reopened + - edited + - labeled + - synchronize + - unlabeled + - ready_for_review +concurrency: + # only one autosquash at a time per PR + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true +jobs: + autosquash: + runs-on: ubuntu-latest + steps: + - name: Get Token + id: app-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.THM_AUTOMATION_APP_ID }} + private-key: ${{ secrets.THM_AUTOMATION_PRIVATE_KEY }} + - uses: actions/checkout@v4 + - uses: theoremlp/autosquash@v1 + with: + github-token: ${{ steps.app-token.outputs.token }} + pull-request-number: ${{ github.event.pull_request.number }} + squash-commit-title: "${{ github.event.pull_request.title }} (#${{ github.event.pull_request.number }})" + squash-commit-message: "${{ github.event.pull_request.body }}" + do-not-merge-label: "do not merge" + required-label: "automerge"