Skip to content

Commit e16d008

Browse files
author
Alexander Rogalskiy
committed
Updates on files
1 parent 29a1992 commit e16d008

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed

.github/actions/skip/action.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# - name: Set Skip Env Var
2+
# uses: ./.github/actions/skip
3+
# - name: Cache local Maven repository
4+
# if: env.SKIP_CI != 'true'
5+
6+
name: "Set Skip Env Var"
7+
description: "Action to set the SKIP_CI environment variable indicating that we should skip CI jobs"
8+
inputs:
9+
paths:
10+
description: >-
11+
Set the SKIP_CI environment variable when and only when all the changed files located in one of the path,
12+
the paths is shell-style pattern.
13+
required: false
14+
default: >-
15+
"*.md"
16+
"*.txt"
17+
"skywalking-ui"
18+
".asf.yaml"
19+
".dlc.yaml"
20+
".licenserc.yaml"
21+
"docs/menu.yml"
22+
".github/actions/skip/action.yml"
23+
".github/workflows/codeql.yaml"
24+
"dist-material/release-docs"
25+
"test/plugin/*"
26+
"*/component-libraries.yml"
27+
28+
runs:
29+
using: "composite"
30+
steps:
31+
- name: Check Changed Files And Set Env Var
32+
shell: bash
33+
run: |
34+
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
35+
exit 0
36+
fi
37+
38+
BASE_SHA=$(jq -r '.pull_request.base.sha' $GITHUB_EVENT_PATH)
39+
echo "Base sha is $BASE_SHA, head sha is $GITHUB_SHA"
40+
41+
git fetch --no-tags --progress --recurse-submodules --depth=1 origin ${BASE_SHA}:origin/${BASE_SHA}
42+
BASE_SHA=origin/${BASE_SHA}
43+
echo "Base sha is $BASE_SHA, head sha is $GITHUB_SHA"
44+
45+
if ! files=$(git --no-pager diff --name-only ${GITHUB_SHA} ${BASE_SHA}); then
46+
exit 1
47+
fi
48+
49+
echo "Ignore pattern:"
50+
for pattern in $(echo '${{ inputs.paths }}'); do
51+
echo $pattern
52+
done
53+
54+
echo "Changed files:"
55+
for file in ${files}; do
56+
echo $file
57+
done
58+
59+
echo "SKIP_CI=true" >> $GITHUB_ENV
60+
for file in ${files}; do
61+
matched=0
62+
for pattern in $(echo '${{ inputs.paths }}'); do
63+
pattern=$(echo "$pattern" | sed 's/"//g')
64+
if eval "[[ '$file' == $pattern ]]"; then
65+
matched=1
66+
break
67+
fi
68+
done
69+
if [[ "$matched" == "0" ]]; then
70+
echo "$file doesn't match pattern $(echo '${{ inputs.paths }}'), stop checking"
71+
echo "SKIP_CI=false" >> $GITHUB_ENV
72+
break
73+
fi
74+
done
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Dead Link Checker
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: dlc-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
CheckDeadLinks:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 30
14+
steps:
15+
- uses: actions/checkout@v2
16+
- run: sudo npm install -g markdown-link-check
17+
- run: |
18+
for file in $(find . -name "*.md"); do
19+
markdown-link-check -c .dlc.json -q "$file"
20+
done

0 commit comments

Comments
 (0)