Skip to content

Commit 8e1bf4c

Browse files
mkardous-silabsandy31415andreilitvinyufengwangca
authored
[CSA-CP] Restore restyler automation (#273)
Co-authored-by: Andrei Litvin <andy314@gmail.com> Co-authored-by: Andrei Litvin <andreilitvin@google.com> Co-authored-by: Yufeng Wang <yufengwang@google.com>
1 parent bbb9d37 commit 8e1bf4c

File tree

2 files changed

+280
-239
lines changed

2 files changed

+280
-239
lines changed

.github/workflows/restyled.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Restyled
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
restyled:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- uses: restyled-io/actions/setup@v4
18+
with:
19+
# TODO: Pinned to v0.6.0.2 because the latest release does not have a pre-built
20+
# 'restyler-linux' asset. This broke our workflow as we rely on the pre-built binary.
21+
# Remove this pin once a new release with the 'restyler-linux' asset is available.
22+
tag: 'v0.6.0.2'
23+
24+
- id: restyler
25+
uses: restyled-io/actions/run@v4
26+
with:
27+
fail-on-differences: true
28+
29+
- if: |
30+
!cancelled() &&
31+
steps.restyler.outputs.success == 'true' &&
32+
github.event.pull_request.head.repo.full_name == github.repository
33+
uses: peter-evans/create-pull-request@v6
34+
with:
35+
base: ${{ steps.restyler.outputs.restyled-base }}
36+
branch: ${{ steps.restyler.outputs.restyled-head }}
37+
title: ${{ steps.restyler.outputs.restyled-title }}
38+
body: ${{ steps.restyler.outputs.restyled-body }}
39+
labels: "restyled"
40+
reviewers: ${{ github.event.pull_request.user.login }}
41+
delete-branch: true

0 commit comments

Comments
 (0)