From 149e56175c56154a2ec4ca849f691ebf3a0ea8ad Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 09:34:33 +0100 Subject: [PATCH 01/10] Try overriding sha --- .github/workflows/workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a9c7c1c9..9975cea5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -145,16 +145,21 @@ jobs: name: docs - name: Commit docs for linting + shell: pwsh run: | git config --global user.name "Github Actions" git config --global user.email "github-actions[bot]@users.noreply.github.com" git add . git commit -m "Update documentation" + $sha = git rev-parse HEAD + Write-Verbose "SHA: $sha" + $env:GITHUB_SHA = $sha - name: Lint documentation uses: super-linter/super-linter/slim@latest env: GITHUB_TOKEN: ${{ github.token }} + GITHUB_SHA: $sha PublishModule: name: Publish module From e22db87fab27c6e8fa3b997f2146dae68ab7ce03 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 09:40:55 +0100 Subject: [PATCH 02/10] test --- .github/workflows/workflow.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9975cea5..d4bc710b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -145,6 +145,7 @@ jobs: name: docs - name: Commit docs for linting + id: commit-docs shell: pwsh run: | git config --global user.name "Github Actions" @@ -153,13 +154,20 @@ jobs: git commit -m "Update documentation" $sha = git rev-parse HEAD Write-Verbose "SHA: $sha" - $env:GITHUB_SHA = $sha + "DOCSHA=$sha" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + + - name: Commit docs for linting + shell: pwsh + run: | + Write-Verbose "SHA: $env:GITHUB_SHA" + env: + GITHUB_SHA: ${{ steps.commit-docs.outputs.DOCSHA }} - name: Lint documentation uses: super-linter/super-linter/slim@latest env: GITHUB_TOKEN: ${{ github.token }} - GITHUB_SHA: $sha + GITHUB_SHA: ${{ steps.commit-docs.outputs.DOCSHA }} PublishModule: name: Publish module From 7dff9f729d7a9af235a496bf582bff7283d5f64e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 10:05:57 +0100 Subject: [PATCH 03/10] test --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d4bc710b..a42acbe2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -153,13 +153,13 @@ jobs: git add . git commit -m "Update documentation" $sha = git rev-parse HEAD - Write-Verbose "SHA: $sha" + Write-Verbose "SHA: $sha" -Verbose "DOCSHA=$sha" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - name: Commit docs for linting shell: pwsh run: | - Write-Verbose "SHA: $env:GITHUB_SHA" + Write-Verbose "SHA: $env:GITHUB_SHA" -Verbose env: GITHUB_SHA: ${{ steps.commit-docs.outputs.DOCSHA }} From 888d60015e9a241f539f9dc1696253b1a3aa1d52 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 18:49:29 +0100 Subject: [PATCH 04/10] test --- .github/workflows/workflow.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a42acbe2..fe7f6272 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -152,22 +152,12 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git add . git commit -m "Update documentation" - $sha = git rev-parse HEAD - Write-Verbose "SHA: $sha" -Verbose - "DOCSHA=$sha" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - - - name: Commit docs for linting - shell: pwsh - run: | - Write-Verbose "SHA: $env:GITHUB_SHA" -Verbose - env: - GITHUB_SHA: ${{ steps.commit-docs.outputs.DOCSHA }} - name: Lint documentation uses: super-linter/super-linter/slim@latest env: GITHUB_TOKEN: ${{ github.token }} - GITHUB_SHA: ${{ steps.commit-docs.outputs.DOCSHA }} + RUN_LOCAL: true PublishModule: name: Publish module From 7260c311a37426401bc19ddb5d1d5a1b7a180fee Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 18:55:52 +0100 Subject: [PATCH 05/10] test --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index fe7f6272..360b55c8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -156,6 +156,8 @@ jobs: - name: Lint documentation uses: super-linter/super-linter/slim@latest env: + DEFAULT_BRANCH: main + DEFAULT_WORKSPACE: ${{ github.workspace }} GITHUB_TOKEN: ${{ github.token }} RUN_LOCAL: true From c1f9bb117b0bc074aaf6d4e8daf1f26801ffe09f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 19:00:19 +0100 Subject: [PATCH 06/10] fix --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 360b55c8..f05b6cbf 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -160,6 +160,7 @@ jobs: DEFAULT_WORKSPACE: ${{ github.workspace }} GITHUB_TOKEN: ${{ github.token }} RUN_LOCAL: true + ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true PublishModule: name: Publish module From 3b03d42941e070c800ea8c467d66592e9d5f9de3 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 19:17:50 +0100 Subject: [PATCH 07/10] test with an issue --- .github/workflows/workflow.yml | 10 +++++----- tests/src/PSModuleTest/public/New-PSModuleTest.ps1 | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f05b6cbf..5bb82459 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -134,10 +134,10 @@ jobs: needs: BuildModule runs-on: ubuntu-latest steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 + - name: Init empty repository + shell: pwsh + run: | + git init --initial-branch=main - name: Download docs artifact uses: actions/download-artifact@v4 @@ -159,7 +159,7 @@ jobs: DEFAULT_BRANCH: main DEFAULT_WORKSPACE: ${{ github.workspace }} GITHUB_TOKEN: ${{ github.token }} - RUN_LOCAL: true + RUN_LOCAL: true # Running "locally" to avoid issues with the GitHub Actions environment. ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true PublishModule: diff --git a/tests/src/PSModuleTest/public/New-PSModuleTest.ps1 b/tests/src/PSModuleTest/public/New-PSModuleTest.ps1 index 7f26215f..fa53198f 100644 --- a/tests/src/PSModuleTest/public/New-PSModuleTest.ps1 +++ b/tests/src/PSModuleTest/public/New-PSModuleTest.ps1 @@ -3,7 +3,7 @@ function New-PSModuleTest { <# .SYNOPSIS - Performs tests on a module. + Performs tests on a module. Repo. .EXAMPLE Test-PSModule -Name 'World' From 724b34626726ed52f6297b2e62251a09b7d991ea Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 19:23:49 +0100 Subject: [PATCH 08/10] test --- .github/workflows/workflow.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5bb82459..50b4c3b4 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -144,14 +144,14 @@ jobs: with: name: docs - - name: Commit docs for linting - id: commit-docs - shell: pwsh - run: | - git config --global user.name "Github Actions" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add . - git commit -m "Update documentation" + # - name: Commit docs for linting + # id: commit-docs + # shell: pwsh + # run: | + # git config --global user.name "Github Actions" + # git config --global user.email "github-actions[bot]@users.noreply.github.com" + # git add . + # git commit -m "Update documentation" - name: Lint documentation uses: super-linter/super-linter/slim@latest @@ -159,7 +159,7 @@ jobs: DEFAULT_BRANCH: main DEFAULT_WORKSPACE: ${{ github.workspace }} GITHUB_TOKEN: ${{ github.token }} - RUN_LOCAL: true # Running "locally" to avoid issues with the GitHub Actions environment. + RUN_LOCAL: true # Running "locally" to avoid issues with GITHUB_SHA issue of a squash merge. ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true PublishModule: From fa35c066a490cd6467d38dab452678dcd0fe7da4 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 19:34:49 +0100 Subject: [PATCH 09/10] revert --- .github/workflows/workflow.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 50b4c3b4..52524c1c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -144,14 +144,14 @@ jobs: with: name: docs - # - name: Commit docs for linting - # id: commit-docs - # shell: pwsh - # run: | - # git config --global user.name "Github Actions" - # git config --global user.email "github-actions[bot]@users.noreply.github.com" - # git add . - # git commit -m "Update documentation" + - name: Commit docs for linting + id: commit-docs + shell: pwsh + run: | + git config --global user.name "Github Actions" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Update documentation" - name: Lint documentation uses: super-linter/super-linter/slim@latest From 09c857da7863c94b374024a1f1a8789b347b96b5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 26 Mar 2024 19:40:52 +0100 Subject: [PATCH 10/10] test --- tests/src/PSModuleTest/public/New-PSModuleTest.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/PSModuleTest/public/New-PSModuleTest.ps1 b/tests/src/PSModuleTest/public/New-PSModuleTest.ps1 index fa53198f..7f26215f 100644 --- a/tests/src/PSModuleTest/public/New-PSModuleTest.ps1 +++ b/tests/src/PSModuleTest/public/New-PSModuleTest.ps1 @@ -3,7 +3,7 @@ function New-PSModuleTest { <# .SYNOPSIS - Performs tests on a module. Repo. + Performs tests on a module. .EXAMPLE Test-PSModule -Name 'World'