Skip to content

Commit

Permalink
add docs for triggering lite via label
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed May 27, 2024
1 parent 48162aa commit fb4e207
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
27 changes: 27 additions & 0 deletions content/lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ jobs:
if: always()
```
pre-commit ci will skip pushes made by bots to prevent infinite loops.
to trigger an autofix in that scenario, set up a `labeled` trigger:

```diff
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -1,13 +1,19 @@
on:
pull_request:
+ types: [labeled, opened, reopened, synchronize]
push:
branches: [main, test-me-*]
jobs:
main:
+ if: "github.event.action != 'labeled' || github.event.label.name == 'pre-commit ci run'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
+ - run: gh pr edit ${{ github.event.number }} --remove-label 'pre-commit ci run'
+ if: github.event.action == 'labeled' && github.event.label.name == 'pre-commit ci run'
+ env:
+ GH_TOKEN: ${{ github.token }}
- uses: actions/setup-python@v4
with:
python-version: 3.x
```

[GitHub Application]: https://github.com/apps/pre-commit-ci-lite/installations/new
[GitHub action]: https://github.com/pre-commit-ci/lite-action
Expand Down
36 changes: 36 additions & 0 deletions tmpl/lite.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,42 @@
padding: 0.5rem;
}

.highlight .hll { background-color: #ffc; }
.highlight .c { color: #008000; } /* Comment */
.highlight .err { border: 1px solid #ff0; } /* Error */
.highlight .k { color: #00f; } /* Keyword */
.highlight .cm { color: #008000; } /* Comment.Multiline */
.highlight .cp { color: #00f; } /* Comment.Preproc */
.highlight .c1 { color: #008000; } /* Comment.Single */
.highlight .cs { color: #008000; } /* Comment.Special */
.highlight .ge { font-style: italic; } /* Generic.Emph */
.highlight .gh { font-weight: bold; } /* Generic.Heading */
.highlight .gp { font-weight: bold; } /* Generic.Prompt */
.highlight .gs { font-weight: bold; } /* Generic.Strong */
.highlight .gu { font-weight: bold; } /* Generic.Subheading */
.highlight .kc { color: #00f; } /* Keyword.Constant */
.highlight .kd { color: #00f; } /* Keyword.Declaration */
.highlight .kn { color: #00f; } /* Keyword.Namespace */
.highlight .kp { color: #00f; } /* Keyword.Pseudo */
.highlight .kr { color: #00f; } /* Keyword.Reserved */
.highlight .kt { color: #2b91af; } /* Keyword.Type */
.highlight .s { color: #a31515; } /* Literal.String */
.highlight .nc { color: #2b91af; } /* Name.Class */
.highlight .ow { color: #00f; } /* Operator.Word */
.highlight .sb { color: #a31515; } /* Literal.String.Backtick */
.highlight .sc { color: #a31515; } /* Literal.String.Char */
.highlight .sd { color: #a31515; } /* Literal.String.Doc */
.highlight .s2 { color: #a31515; } /* Literal.String.Double */
.highlight .se { color: #a31515; } /* Literal.String.Escape */
.highlight .sh { color: #a31515; } /* Literal.String.Heredoc */
.highlight .si { color: #a31515; } /* Literal.String.Interpol */
.highlight .sx { color: #a31515; } /* Literal.String.Other */
.highlight .sr { color: #a31515; } /* Literal.String.Regex */
.highlight .s1 { color: #a31515; } /* Literal.String.Single */
.highlight .ss { color: #a31515; } /* Literal.String.Symbol */
.highlight .gi { color: #070; }
.highlight .gd { color: #911; }

</style>
</head>

Expand Down

0 comments on commit fb4e207

Please sign in to comment.