From 4df887c14fb1c1d62e04734af991d92a58bf8540 Mon Sep 17 00:00:00 2001 From: Spencer Schrock Date: Mon, 24 Jul 2023 14:10:13 -0700 Subject: [PATCH] :seedling: Ensure check markdown is kept in sync with source yaml. (#3300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ensure check markdown is kept in sync with check yaml. Signed-off-by: Spencer Schrock * change generate-docs target to detect changes to docs/checks.md directly. Signed-off-by: Spencer Schrock --------- Signed-off-by: Spencer Schrock Signed-off-by: André Backman --- .github/workflows/main.yml | 30 ++++++------------------------ Makefile | 3 +-- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a995caa1c77..2e8df3a5b15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -143,39 +143,19 @@ jobs: contents: read steps: - name: Harden Runner - uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v1 + uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - - name: Install Protoc - uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0 - with: - version: ${{ env.PROTOC_VERSION }} - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Cache builds - # https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: Clone the code - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v2.3.4 - with: - fetch-depth: 0 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v2.2.0 + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ env.GO_VERSION }} check-latest: true cache: true - name: generate docs - uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd + uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3 with: max_attempts: 3 retry_on: error @@ -183,6 +163,8 @@ jobs: command: | go env -w GOFLAGS=-mod=mod make generate-docs + - name: ensure checks.yaml and checks.md match + run: git diff --exit-code build-proto: name: build-proto runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 720cdcca426..d3800a19b41 100644 --- a/Makefile +++ b/Makefile @@ -161,8 +161,7 @@ cmd/internal/nuget/nuget_mockclient.go: cmd/internal/nuget/client.go | $(MOCKGEN $(MOCKGEN) -source=cmd/internal/nuget/client.go -destination=cmd/internal/nuget/nuget_mockclient.go -package=nuget -copyright_file=clients/mockclients/license.txt generate-docs: ## Generates docs -generate-docs: validate-docs docs/checks.md -docs/checks.md: docs/checks/internal/checks.yaml docs/checks/internal/*.go docs/checks/internal/generate/*.go +generate-docs: validate-docs docs/checks.md docs/checks/internal/checks.yaml docs/checks/internal/*.go docs/checks/internal/generate/*.go # Generating checks.md go run ./docs/checks/internal/generate/main.go docs/checks.md