File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 15
15
# https://github.com/crazy-max/ghaction-github-pages/issues/1#issuecomment-623202206
16
16
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
17
17
steps :
18
- - uses : actions/checkout@v2
18
+ - uses : actions/checkout@v3
19
+ with :
20
+ fetch-depth : ${{ github.event_name == 'pull_request' && 2 || 0 }}
21
+ - name : Get changed files
22
+ id : changed-files
23
+ # source: https://stackoverflow.com/a/74268200
24
+ run : |
25
+ if ${{ github.event_name == 'pull_request' }}; then
26
+ echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
27
+ else
28
+ echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
29
+ fi
19
30
- name : Lint
20
31
uses : avto-dev/markdown-lint@v1
21
32
with :
25
36
run : |
26
37
npm install -g @umbrelladocs/linkspector
27
38
echo "linkspector version: $(linkspector --version)"
28
- echo "Files changed in this pr: $(git diff --name-only $ {{ github.event.before }} ${{ github.sha }}) "
29
- linkspector check $(git diff --name-only $ {{ github.event.before }} ${{ github.sha }})
39
+ echo "Files changed in this pr: ${{ steps.changed-files.outputs.changed_files }}"
40
+ linkspector check ${{ steps.changed-files.outputs.changed_files }}
30
41
- name : Install Zola
31
42
run : curl -L ${BASE_URL}/${VERS}/zola-${VERS}-${ARCH}.tar.gz | tar -xz
32
43
- run : ./zola --version
You can’t perform that action at this time.
0 commit comments