-
Notifications
You must be signed in to change notification settings - Fork 17
153 lines (138 loc) · 6.54 KB
/
ActionChecker.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
name: ActionChecker
on:
push:
branches: #[ master ]
- "[Ff]eature-*"
paths:
- '**.md'
pull_request:
branches: [ QA ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
ActionChecker:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: '' #get changed files
id: getfileCount
run: |
echo "name=filesCount::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} -- '*.md'| wc -l)" >>GITHUB_STATE
- name: '' #get changed files
id: getfile
run: |
echo "name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} -- '*.md' | xargs)" >>GITHUB_STATE
- name: '' #get changed fileName
if: ${{ steps.getfileCount.outputs.filesCount == 1}}
id: getfileName
run: |
echo "name=fileName::$(basename -a ${{ steps.getfile.outputs.files }})" >>GITHUB_STATE
- name: '' #get changed fileName Only
if: ${{ steps.getfileCount.outputs.filesCount == 1}}
id: getfileNameOnly
run: |
echo "name=fileNameOnly::$(echo ${{ steps.getfileName.outputs.fileName }} | cut -f 1 -d '.')" >>GITHUB_STATE
- name: '' #get changed files
id: getDirName
run: |
echo "name=dirs::$(dirname ${{ steps.getfile.outputs.files }})" >>GITHUB_STATE
#- name: echo output
#run: |
#echo ${{ steps.getfile.outputs.files }}
#echo ${{ steps.getfileName.outputs.fileName }}
#echo ${{ steps.getfileNameOnly.outputs.fileNameOnly }}
#echo ${{ steps.getDirName.outputs.dirs }}
- name: Spell Checker
if: always()
uses: zwaldowski/cspell-action@v1
with:
# Glob pattern of files to check
paths: ${{ steps.getfile.outputs.files }}
config: .github/workflows/cspell.json
# Configuration file to use. By default cspell looks for cspell.json in the current directory.
#config: # optional
# Exclude files matching the glob pattern
#exclude: # optional
# Only output the first instance of a word not found in the dictionaries.
#unique: # optional
- name: Markdown Link Checker
if: always()
uses: ruzickap/action-my-markdown-link-checker@v1
with:
# markdown-link-check config file
#config_file: # optional
# Debug mode
#debug: # optional
# Exclude files or directories
#exclude: # optional
# Command line parameters for fd command. "exclude" and "search_paths" parameters are ignored if this is set
#fd_cmd_params: # optional
# Quiet mode for markdown-link-check
#quiet: # optional
# Set paths which should be recursively scanned for markdown files (*.md) and linted. By default all "*.md" files are checked
search_paths: ${{ steps.getDirName.outputs.dirs }} # optional
# Verbose mode for markdown-link-check
#verbose: # optional
#This portion of code will execute if a single markdown file within a folder is changed. If no markdown file is changed, or more than one file is changed, then the entire directory will be checked.
- name: Markdown Linter for Changed File Scan
if: ${{ always() && steps.getfileCount.outputs.filesCount == 1}}
uses: ruzickap/action-my-markdown-linter@v1
with:
# markdownlint config file
config_file: .github/workflows/markdownlint.json # optional
# Debug mode
#debug: # optional
# Exclude files or directories
#exclude: # optional
# Command line parameters for fd command. "exclude" and "search_paths" parameters are ignored if this is set
fd_cmd_params: "-0 --extension md ${{ steps.getfileNameOnly.outputs.fileNameOnly }} --type f --hidden --no-ignore --full-path ${{ steps.getDirName.outputs.dirs }}" # optional
# Set paths which should be recursively scanned for markdown files (*.md) and linted. By default all "*.md" files are checked
#search_paths: ${{ steps.getDirName.outputs.dirs }} # optional
#This portion of code will execute if no markdown files, or more than one markdown file is changed and will check the entire directory.
- name: Markdown Linter for Directory Level Scan
if: ${{ always() && steps.getfileCount.outputs.filesCount != 1}}
uses: ruzickap/[email protected]
with:
# markdownlint config file
config_file: .github/workflows/markdownlint.json # optional
# Debug mode
#debug: # optional
# Exclude files or directories
#exclude: # optional
# Command line parameters for fd command. "exclude" and "search_paths" parameters are ignored if this is set
#fd_cmd_params: "-0 --extension md ${{ steps.getfileNameOnly.outputs.fileNameOnly }} --type f --hidden --no-ignore --full-path ${{ steps.getDirName.outputs.dirs }}" # optional
# Set paths which should be recursively scanned for markdown files (*.md) and linted. By default all "*.md" files are checked
search_paths: ${{ steps.getDirName.outputs.dirs }} # optional
- name: GitHub Pull Request Action
if: always()
uses: repo-sync/[email protected]
with:
# Branch name to pull from, default is triggered branch
#source_branch: 'Feature' # optional
# Branch name to sync to in this repo, default is master
destination_branch: 'gh-pages' # optional, default is master
# Pull request title
#pr_title: # optional
# Pull request body
#pr_body: # optional
# Pull request template
#pr_template: # optional
# Pull request reviewers, comma-separated list (no spaces)
pr_reviewer: 'lijenn,branscombj,dlkibbe,jamesmrollins' # optional
# Pull request assignees, comma-separated list (no spaces)
#pr_assignee: # optional
# Pull request labels, comma-separated list (no spaces)
#pr_label: # optional
# Pull request milestone
#pr_milestone: # optional
# Draft pull request
#pr_draft: # optional
# Create PR even if no changes
#pr_allow_empty: # optional
# GitHub token secret
github_token: ${{ secrets.GITHUB_TOKEN }}