-
Notifications
You must be signed in to change notification settings - Fork 21
88 lines (77 loc) · 3.2 KB
/
spellcheck.yaml
File metadata and controls
88 lines (77 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# ------------------------------------------------------------
# Copyright 2023 The Radius Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
---
name: Spellcheck
on:
workflow_dispatch:
pull_request:
branches:
- main
env:
ACTION_LINK: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
concurrency:
group: spellcheck-${{ github.ref }}-${{ github.event.pull_request.number || github.sha }}
permissions: {}
jobs:
spellcheck:
name: Spellcheck
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Spellcheck
uses: rojopolis/spellcheck-github-actions@16d0338a5a3b5e3111a078029fb9a07a8125053d # 0.55.0
with:
config_path: .github/config/.pyspelling.yml
- name: Post GitHub workkflow output on failure
if: failure()
run: |
{
echo "## :x: Spellcheck Failed"
echo "There are spelling errors in your PR. Visit [the workflow output](${{ env.ACTION_LINK }}) to see what words are failing."
echo "### Adding new words"
echo "You can add new custom words to [.github/config/en-custom.txt](https://github.com/radius-project/design-notes/blob/main/.github/config/en-custom.txt)."
} >> "${GITHUB_STEP_SUMMARY}"
- name: Post GitHub workflow output on success
run: |
{
echo "## :white_check_mark: Spellcheck Passed"
echo "There are no spelling errors in your PR."
} >> "${GITHUB_STEP_SUMMARY}"
- name: Post GitHub comment on failure
if: failure()
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
header: spellcheck
recreate: true
message: |
## :x: Spellcheck Failed
There are spelling errors in your PR. Visit [the workflow output](${{ env.ACTION_LINK }}) to see what words are failing.
### Adding new words
You can add new custom words to [.github/config/en-custom.txt](https://github.com/radius-project/design-notes/blob/main/.github/config/en-custom.txt).
- name: Clear GitHub comment on success
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
continue-on-error: true
with:
header: spellcheck
delete: true