You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may be that the solution is with int git hub actions side of things to only pass to tf_docs_working_dir a list of folders where the code has actually changed
I would like the ability to restrict docs to execute only in those subfolders that contain terraform code that has actually changed. This is to avoid docs files being recreated on folders with no changes and skewing timestamps and diffs.
The text was updated successfully, but these errors were encountered:
We solved this by adding another run bash step that return the changed module as a list which terraform doc uses:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Get changed modules
shell: bash
run: |
BLOCK_LIST=(".github" "bin" "_example-module" "configs")
CHANGED_FILES=$(git diff --name-only origin/master..${{ github.ref }} | cut -f1 -d'/' | sort -u)
for FILE in $CHANGED_FILES; do
# Ignore all entries in blocklist
[[ " ${BLOCK_LIST[@]} " =~ " $FILE " ]] && continue
# Ignore all entries that are not folders, and append to MODULES variable
[[ -d ${FILE} ]] && MODULES="${MODULES},${FILE}"
done
# Strip the first comma from the list of modules and make it an environment variable
echo "Modules that have been changed: ${MODULES:1}"
echo MODULES=${MODULES:1} >> $GITHUB_ENV
- name: Automatically generated docs
uses: Dirrk/[email protected]
with:
tf_docs_working_dir: ${{ env.MODULES }}
I think this is what #17 is referencing.
But we too run a mono repo for lots of projects.
It may be that the solution is with int git hub actions side of things to only pass to tf_docs_working_dir a list of folders where the code has actually changed
I would like the ability to restrict docs to execute only in those subfolders that contain terraform code that has actually changed. This is to avoid docs files being recreated on folders with no changes and skewing timestamps and diffs.
The text was updated successfully, but these errors were encountered: