From d4ffeef675f1b416708a1cb0141631b78de099af Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 9 Jan 2022 20:00:44 +0100 Subject: [PATCH 1/6] Delete unnecessary files. --- actions/ansible-docs-build-diff/action.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/actions/ansible-docs-build-diff/action.yml b/actions/ansible-docs-build-diff/action.yml index 9dc1b18..1037c54 100644 --- a/actions/ansible-docs-build-diff/action.yml +++ b/actions/ansible-docs-build-diff/action.yml @@ -1,6 +1,9 @@ --- name: Calculate diff output between two Ansible docs builds -description: Compare two builds of docs (HTML files) and produce diff output. +description: | + Compare two builds of docs (HTML files) and produce diff output. + + Please note that the input directories might be modified, as some files will be deleted. inputs: build-html-a: description: The path to the HTML files (set A). @@ -75,6 +78,14 @@ outputs: runs: using: composite steps: + - name: Delete files that should not be included in the diff + run: | + echo "::group::Deleting files from ${{ inputs.build-html-a }}" + find "${{ inputs.build-html-a }}" -name '*.js' -or -name '*.inv' -delete -print + echo "::endgroup::" + echo "::group::Deleting files from ${{ inputs.build-html-b }}" + find "${{ inputs.build-html-b }}" -name '*.js' -or -name '*.inv' -delete -print + echo "::endgroup::" - name: Create diff id: diff uses: actions/github-script@v5 From 56a093bc81a32a4d02b8d5c259b4f22365c7e6ce Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 9 Jan 2022 20:07:09 +0100 Subject: [PATCH 2/6] Actually use action from this branch. Needs to be reverted before merging. --- .github/workflows/_shared-docs-build-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_shared-docs-build-pr.yml b/.github/workflows/_shared-docs-build-pr.yml index aa2efe5..8534521 100644 --- a/.github/workflows/_shared-docs-build-pr.yml +++ b/.github/workflows/_shared-docs-build-pr.yml @@ -222,7 +222,7 @@ jobs: - name: Get a diff of the changes if: steps.build-base.outputs.hash != steps.build-head.outputs.hash id: diff - uses: ansible-community/github-docs-build/actions/ansible-docs-build-diff@main + uses: felixfontein/github-docs-build/actions/ansible-docs-build-diff@fix-merge with: build-html-a: ${{ steps.build-base.outputs.build-html }} build-html-b: ${{ steps.build-head.outputs.build-html }} From c910346c8bdb85e5996e854dd1a892a45680866c Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 9 Jan 2022 20:08:38 +0100 Subject: [PATCH 3/6] Add missing tags. --- actions/ansible-docs-build-diff/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/actions/ansible-docs-build-diff/action.yml b/actions/ansible-docs-build-diff/action.yml index 1037c54..5a3fee4 100644 --- a/actions/ansible-docs-build-diff/action.yml +++ b/actions/ansible-docs-build-diff/action.yml @@ -79,6 +79,8 @@ runs: using: composite steps: - name: Delete files that should not be included in the diff + id: delete + shell: bash run: | echo "::group::Deleting files from ${{ inputs.build-html-a }}" find "${{ inputs.build-html-a }}" -name '*.js' -or -name '*.inv' -delete -print From 4878690301c5a3b9e0ac952e9232f69db5c63e76 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 9 Jan 2022 20:12:35 +0100 Subject: [PATCH 4/6] Add brackets. --- actions/ansible-docs-build-diff/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/ansible-docs-build-diff/action.yml b/actions/ansible-docs-build-diff/action.yml index 5a3fee4..a05e277 100644 --- a/actions/ansible-docs-build-diff/action.yml +++ b/actions/ansible-docs-build-diff/action.yml @@ -83,10 +83,10 @@ runs: shell: bash run: | echo "::group::Deleting files from ${{ inputs.build-html-a }}" - find "${{ inputs.build-html-a }}" -name '*.js' -or -name '*.inv' -delete -print + find "${{ inputs.build-html-a }}" \( -name '*.js' -or -name '*.inv' \) -delete -print echo "::endgroup::" echo "::group::Deleting files from ${{ inputs.build-html-b }}" - find "${{ inputs.build-html-b }}" -name '*.js' -or -name '*.inv' -delete -print + find "${{ inputs.build-html-b }}" \( -name '*.js' -or -name '*.inv' \) -delete -print echo "::endgroup::" - name: Create diff id: diff From fec74574a8c754d0b03eddde470e42536bedd108 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 10 Jan 2022 06:41:54 +0100 Subject: [PATCH 5/6] Update actions/ansible-docs-build-diff/action.yml Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com> --- actions/ansible-docs-build-diff/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/ansible-docs-build-diff/action.yml b/actions/ansible-docs-build-diff/action.yml index a05e277..54bcdc6 100644 --- a/actions/ansible-docs-build-diff/action.yml +++ b/actions/ansible-docs-build-diff/action.yml @@ -88,6 +88,7 @@ runs: echo "::group::Deleting files from ${{ inputs.build-html-b }}" find "${{ inputs.build-html-b }}" \( -name '*.js' -or -name '*.inv' \) -delete -print echo "::endgroup::" + - name: Create diff id: diff uses: actions/github-script@v5 From 9fbeddc6d2c8e7738103ab4d014b3a91810dc2fa Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 10 Jan 2022 06:42:09 +0100 Subject: [PATCH 6/6] Revert "Actually use action from this branch. Needs to be reverted before merging." This reverts commit 56a093bc81a32a4d02b8d5c259b4f22365c7e6ce. --- .github/workflows/_shared-docs-build-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_shared-docs-build-pr.yml b/.github/workflows/_shared-docs-build-pr.yml index 8534521..aa2efe5 100644 --- a/.github/workflows/_shared-docs-build-pr.yml +++ b/.github/workflows/_shared-docs-build-pr.yml @@ -222,7 +222,7 @@ jobs: - name: Get a diff of the changes if: steps.build-base.outputs.hash != steps.build-head.outputs.hash id: diff - uses: felixfontein/github-docs-build/actions/ansible-docs-build-diff@fix-merge + uses: ansible-community/github-docs-build/actions/ansible-docs-build-diff@main with: build-html-a: ${{ steps.build-base.outputs.build-html }} build-html-b: ${{ steps.build-head.outputs.build-html }}