-
Notifications
You must be signed in to change notification settings - Fork 160
164 lines (153 loc) · 4.89 KB
/
check.yml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: check
on: [push, pull_request, workflow_dispatch]
jobs:
code_qualify_check:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- uses: actions/checkout@v4
- name: check
run: python3 .github/workflows/script/code_qualify_check.py
defined_word_check:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- uses: actions/checkout@v4
- name: check
run: python3 .github/workflows/script/defined_word_check.py
display_error_check:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- uses: actions/checkout@v4
- name: check
run: python3 .github/workflows/script/display_error_check.py
inner_link_check:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- uses: actions/checkout@v4
- name: check
run: python3 .github/workflows/script/link_check.py --check-inner-link
meta_header_check:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- uses: actions/checkout@v4
- name: check
run: python3 .github/workflows/script/meta_header_check.py
ngword_check:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- uses: actions/checkout@v4
- name: check
run: python3 .github/workflows/script/ngword_check.py
detect_forbidden_characters:
# 本リポジトリでは、以下に挙げる文字の使用を禁止している:
# U+00AD SOFT HYPHEN (ソフトハイフン)
# U+200B ZERO WIDTH SPACE (ゼロ幅スペース)
#
# 経緯は以下を参照:
# #735 SOFT HYPHENを削除する?
# https://github.com/cpprefjp/site/issues/735
runs-on: ubuntu-latest
env:
RIPGREP_VERSION: 14.1.0
BIN_DIR: ${{ github.workspace }}/bin
REPO_DIR: repo
cache-version: v1
steps:
- id: cache-ripgrep
uses: actions/cache@v3
with:
path: ${{ env.BIN_DIR }}
key: ${{ env.cache-version }}-ripgrep-${{ env.RIPGREP_VERSION }}
- name: install ripgrep
if: steps.cache-ripgrep.outputs.cache-hit != 'true'
run: |
curl -fsSLO https://github.com/BurntSushi/ripgrep/releases/download/$RIPGREP_VERSION/ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz
mkdir -p $BIN_DIR
tar xvf ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz --strip=1 --no-anchor -C $BIN_DIR rg
working-directory: ${{ runner.temp }}
- uses: actions/checkout@v4
with:
path: ${{ env.REPO_DIR }}
- name: check
run: "! $BIN_DIR/rg -t md --vimgrep '[\u00ad\u200b]' $REPO_DIR"
build:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') }}
uses: ./.github/workflows/build.yml
with:
arguments: --head ${{ github.ref }}
concurrency:
group: cpprefjp.gh-pages.lock
debug:
if: github.event_name == 'pull_request'
steps:
- uses: actions/github-script@v7
script: console.log(JSON.stringify(context));
comment:
if: github.event_name == 'pull_request' && github.event.action == 'opened'
steps:
- id: variables
env:
github_ref: ${{ github.ref }}
run: |
const branch = process.env.github_ref.replace(/^refs\/heads\//, "");
core.setOutput('branch', urlencode(branch));
- uses: actions/github-script@v7
env:
content: |
https://github.com/${{ github.event.pull_request.head.repo.full_name }}/actions?query=branch%3A${{ steps.variables.outputs.branch }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.content
})