pb/closed testing #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Restyled | |
on: | |
pull_request: | |
types: | |
# Types when we want to Restyle | |
- opened | |
- reopened | |
- synchronize | |
# So we can clean up if necessary | |
- closed | |
jobs: | |
restyled: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- uses: restyled-io/actions/setup@v3 | |
- id: restyler | |
uses: restyled-io/actions/run@v3 | |
with: | |
fail-on-differences: true | |
- if: | | |
!cancelled() && | |
steps.restyler.outputs.success == 'true' && | |
github.event.pull_request.head.repo.full_name == github.repository | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
base: ${{ steps.restyler.outputs.restyled-base }} | |
branch: ${{ steps.restyler.outputs.restyled-head }} | |
title: ${{ steps.restyler.outputs.restyled-title }} | |
body: ${{ steps.restyler.outputs.restyled-body }} | |
labels: restyled | |
reviewers: ${{ github.event.pull_request.user.login }} | |
delete-branch: true | |
- if: ${{ github.event.pull_request.state == 'closed' }} | |
run: gh pr close --delete-branch "$RESTYLED_BRANCH" || true | |
env: | |
RESTYLED_BRANCH: ${{ steps.restyler.outputs.restyled-head }} | |
GH_TOKEN: ${{ github.token }} |