Skip to content

Commit 9b2997f

Browse files
authored
Merge pull request #511 from onflow/hannah/call-docs-refresh-with-diff
Add github actions for getting diff & calling refresh
2 parents cef20e1 + 1a459bf commit 9b2997f

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow is stored and called from each repository that contains documentation files
2+
name: call-refresh-doc
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
compare:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Get changed files
15+
id: changed-files
16+
uses: tj-actions/changed-files@v19
17+
with:
18+
files: |
19+
docs/**/*.md
20+
docs/**/*.mdx
21+
22+
# --- Log all diff info ---
23+
- name: Log the files commit SHA if any md/mdx files have diffs
24+
continue-on-error: true
25+
if: steps.changed-files.outputs.any_modified == 'true'
26+
run: |
27+
for file in ${{ steps.changed-files.outputs.all_modified_files }}; do
28+
echo "$file was modified" with the commit ${{ github.sha }}
29+
done
30+
for file in ${{ steps.changed-files.outputs.added_files }}; do
31+
echo "$file was added"
32+
done
33+
for file in ${{ steps.changed-files.outputs.deleted_files }}; do
34+
echo "$file was deleted"
35+
done
36+
for file in ${{ steps.changed-files.outputs.all_modified_files }}; do
37+
echo "$file was modified"
38+
done
39+
outputs:
40+
all_modified_files: ${{ steps.changed-files.outputs.all_modified_files }}
41+
any_modified: ${{ steps.changed-files.outputs.any_modified }}
42+
43+
# --- If modified, call refresh ---
44+
call-refresh-workflow-passing-data:
45+
needs: compare
46+
if: ${{ needs.compare.outputs.all_modified_files != 0 }}
47+
uses: onflow/flow/.github/workflows/refresh-doc.yml@master
48+
with:
49+
contentPaths: ${{ needs.compare.outputs.all_modified_files }}
50+
repository: ${{ github.event.repository.name }}
51+
commitSha: ${{ github.sha }}
52+

0 commit comments

Comments
 (0)