diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml index 3429233..d968bec 100644 --- a/.github/workflows/dependency-updates.yml +++ b/.github/workflows/dependency-updates.yml @@ -38,6 +38,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + # Provided for contrast. Will likely remove this one at some point. - name: go list run: | diff --git a/.github/workflows/go-mod-validation.yml b/.github/workflows/go-mod-validation.yml index d79ea02..fb025a4 100644 --- a/.github/workflows/go-mod-validation.yml +++ b/.github/workflows/go-mod-validation.yml @@ -35,6 +35,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: go mod tidy run: | go mod tidy -v @@ -51,6 +62,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: go mod vendor run: | go mod vendor diff --git a/.github/workflows/lint-and-build-using-ci-matrix.yml b/.github/workflows/lint-and-build-using-ci-matrix.yml index 991f4c2..779332b 100644 --- a/.github/workflows/lint-and-build-using-ci-matrix.yml +++ b/.github/workflows/lint-and-build-using-ci-matrix.yml @@ -48,6 +48,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: Remove repo-provided golangci-lint config file run: | # Remove the copy of the config file bundled with the repo/code so @@ -83,6 +94,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: Run all tests run: go test -mod=vendor -v ./... @@ -105,6 +127,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: Build using vendored dependencies # NOTE: This will fail if there is a doc.go file in the project root # with a message similar to: diff --git a/.github/workflows/lint-and-build-using-make.yml b/.github/workflows/lint-and-build-using-make.yml index 6a6d9f3..a7c16a2 100644 --- a/.github/workflows/lint-and-build-using-make.yml +++ b/.github/workflows/lint-and-build-using-make.yml @@ -47,6 +47,17 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + # bsdmainutils provides "column" which is used by the Makefile - name: Install Ubuntu packages run: apt-get update && apt-get install -y --no-install-recommends make gcc bsdmainutils @@ -96,6 +107,17 @@ jobs: # Needed in order to retrieve tags for use with go generate fetch-depth: 0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: Install Ubuntu packages (standard set) if: ${{ inputs.os-dependencies == '' }} # bsdmainutils provides "column" which is used by the Makefile diff --git a/.github/workflows/lint-project-files.yml b/.github/workflows/lint-project-files.yml index 314f24a..ba253dd 100644 --- a/.github/workflows/lint-project-files.yml +++ b/.github/workflows/lint-project-files.yml @@ -48,6 +48,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: Run Markdown linting tools # The `.markdownlint.yml` file specifies config settings for this # linter, including which linting rules to ignore. @@ -70,6 +81,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: Run hadolint against any Dockerfiles if: hashFiles('**/Dockerfile') != '' run: | diff --git a/.github/workflows/quick-validation.yml b/.github/workflows/quick-validation.yml index db6ea72..b350c31 100644 --- a/.github/workflows/quick-validation.yml +++ b/.github/workflows/quick-validation.yml @@ -35,6 +35,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: Remove repo-provided golangci-lint config file run: | # Remove the copy of the config file bundled with the repo/code so diff --git a/.github/workflows/vulnerability-analysis.yml b/.github/workflows/vulnerability-analysis.yml index 9f6fc98..40d15e3 100644 --- a/.github/workflows/vulnerability-analysis.yml +++ b/.github/workflows/vulnerability-analysis.yml @@ -46,6 +46,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2.2.3 @@ -89,6 +100,17 @@ jobs: - name: Check out code uses: actions/checkout@v3.3.0 + # Mark the current working directory as a safe directory in git to + # resolve "dubious ownership" complaints. + # + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + # https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html + # https://github.com/actions/runner-images/issues/6775 + # https://github.com/actions/checkout/issues/766 + - name: Mark the current working directory as a safe directory in git + # run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory "${PWD}" + - name: Analyze source code run: | echo "govulncheck version $(go version -m $(which govulncheck) | awk '$1 == "mod" { print $3 }')"