Skip to content

Commit fb4e207

Browse files
committed
add docs for triggering lite via label
1 parent 48162aa commit fb4e207

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

content/lite.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,33 @@ jobs:
7272
if: always()
7373
```
7474
75+
pre-commit ci will skip pushes made by bots to prevent infinite loops.
76+
to trigger an autofix in that scenario, set up a `labeled` trigger:
77+
78+
```diff
79+
--- a/.github/workflows/pre-commit.yml
80+
+++ b/.github/workflows/pre-commit.yml
81+
@@ -1,13 +1,19 @@
82+
on:
83+
pull_request:
84+
+ types: [labeled, opened, reopened, synchronize]
85+
push:
86+
branches: [main, test-me-*]
87+
88+
jobs:
89+
main:
90+
+ if: "github.event.action != 'labeled' || github.event.label.name == 'pre-commit ci run'"
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v3
94+
+ - run: gh pr edit ${{ github.event.number }} --remove-label 'pre-commit ci run'
95+
+ if: github.event.action == 'labeled' && github.event.label.name == 'pre-commit ci run'
96+
+ env:
97+
+ GH_TOKEN: ${{ github.token }}
98+
- uses: actions/setup-python@v4
99+
with:
100+
python-version: 3.x
101+
```
75102

76103
[GitHub Application]: https://github.com/apps/pre-commit-ci-lite/installations/new
77104
[GitHub action]: https://github.com/pre-commit-ci/lite-action

tmpl/lite.html.tmpl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,42 @@
5959
padding: 0.5rem;
6060
}
6161

62+
.highlight .hll { background-color: #ffc; }
63+
.highlight .c { color: #008000; } /* Comment */
64+
.highlight .err { border: 1px solid #ff0; } /* Error */
65+
.highlight .k { color: #00f; } /* Keyword */
66+
.highlight .cm { color: #008000; } /* Comment.Multiline */
67+
.highlight .cp { color: #00f; } /* Comment.Preproc */
68+
.highlight .c1 { color: #008000; } /* Comment.Single */
69+
.highlight .cs { color: #008000; } /* Comment.Special */
70+
.highlight .ge { font-style: italic; } /* Generic.Emph */
71+
.highlight .gh { font-weight: bold; } /* Generic.Heading */
72+
.highlight .gp { font-weight: bold; } /* Generic.Prompt */
73+
.highlight .gs { font-weight: bold; } /* Generic.Strong */
74+
.highlight .gu { font-weight: bold; } /* Generic.Subheading */
75+
.highlight .kc { color: #00f; } /* Keyword.Constant */
76+
.highlight .kd { color: #00f; } /* Keyword.Declaration */
77+
.highlight .kn { color: #00f; } /* Keyword.Namespace */
78+
.highlight .kp { color: #00f; } /* Keyword.Pseudo */
79+
.highlight .kr { color: #00f; } /* Keyword.Reserved */
80+
.highlight .kt { color: #2b91af; } /* Keyword.Type */
81+
.highlight .s { color: #a31515; } /* Literal.String */
82+
.highlight .nc { color: #2b91af; } /* Name.Class */
83+
.highlight .ow { color: #00f; } /* Operator.Word */
84+
.highlight .sb { color: #a31515; } /* Literal.String.Backtick */
85+
.highlight .sc { color: #a31515; } /* Literal.String.Char */
86+
.highlight .sd { color: #a31515; } /* Literal.String.Doc */
87+
.highlight .s2 { color: #a31515; } /* Literal.String.Double */
88+
.highlight .se { color: #a31515; } /* Literal.String.Escape */
89+
.highlight .sh { color: #a31515; } /* Literal.String.Heredoc */
90+
.highlight .si { color: #a31515; } /* Literal.String.Interpol */
91+
.highlight .sx { color: #a31515; } /* Literal.String.Other */
92+
.highlight .sr { color: #a31515; } /* Literal.String.Regex */
93+
.highlight .s1 { color: #a31515; } /* Literal.String.Single */
94+
.highlight .ss { color: #a31515; } /* Literal.String.Symbol */
95+
.highlight .gi { color: #070; }
96+
.highlight .gd { color: #911; }
97+
6298
</style>
6399
</head>
64100

0 commit comments

Comments
 (0)