Skip to content

Commit

Permalink
Move to suggestions restyled workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Nov 20, 2024
1 parent 4082710 commit 5cc39d9
Showing 1 changed file with 5 additions and 45 deletions.
50 changes: 5 additions & 45 deletions .github/workflows/restyled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,19 @@ name: Restyled

on:
pull_request:
types:
- opened
- reopened
- closed
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
restyled:
if: |
github.event.action != 'closed' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: restyled-io/actions/setup@v4
- id: restyler
uses: restyled-io/actions/run@v4
with:
fail-on-differences: true
- if: ${{ !cancelled() && steps.restyler.outputs.success == 'true' }}
uses: peter-evans/create-pull-request@v7
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

restyled-fork:
if: |
github.event.action != 'closed' &&
github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: restyled-io/actions/setup@v4
- uses: restyled-io/actions/run@v4
with:
fail-on-differences: true

restyled-cleanup:
if: ${{ github.event.action == 'closed' }}
runs-on: ubuntu-latest
steps:
- uses: restyled-io/actions/setup@v4
- id: restyler
uses: restyled-io/actions/run@v4
- run: gh --repo "$REPO" pr close "$BRANCH" --delete-branch || true
env:
REPO: ${{ github.repository }}
BRANCH: ${{ steps.restyler.outputs.restyled-head }}
GH_TOKEN: ${{ github.token }}
suggestions: true

0 comments on commit 5cc39d9

Please sign in to comment.