From 579daab0871f4b876dd444bc1aaccf1573d2c995 Mon Sep 17 00:00:00 2001 From: Tit Petric Date: Tue, 22 Aug 2023 21:53:34 +0200 Subject: [PATCH] Update api changes workflow, remove godoc taskfile --- .github/workflows/api-changes.yml | 65 +------------------------------ .taskfiles/godoc/Taskfile.yml | 20 ---------- 2 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 .taskfiles/godoc/Taskfile.yml diff --git a/.github/workflows/api-changes.yml b/.github/workflows/api-changes.yml index 8804d42a61b4..6a7e3d287d4b 100644 --- a/.github/workflows/api-changes.yml +++ b/.github/workflows/api-changes.yml @@ -11,69 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Tyk - uses: actions/checkout@v3 + - uses: TykTechnologies/github-actions/.github/workflows/godoc.yml@1e98fcf2bc8abfabb146718459f40ab682e53287 with: fetch-depth: 1 - - - name: Setup Golang - uses: actions/setup-go@v4 - with: - go-version: "1.20" - - - name: Install Task - uses: arduino/setup-task@v1 - with: - version: 3 - - - name: Fetch base branch - run: git fetch origin ${{ github.base_ref }} - - - name: Stash taskfiles - run: | - mkdir -p /tmp/.taskfiles - rsync -a ./.taskfiles/ /tmp/.taskfiles/ - - - name: Set up comment author - run: | - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - - - name: Collect API docs - run: | - go mod tidy - task -t .taskfiles/godoc/Taskfile.yml > current.txt - git checkout -- . - git checkout ${{ github.base_ref }} - go mod tidy - rsync -a /tmp/.taskfiles/ .taskfiles/ - task -t .taskfiles/godoc/Taskfile.yml > prev.txt - - - name: Diff API docs - id: api-check - run: | - set +e - diff -u prev.txt current.txt > changes.txt - echo "diff-output<> $GITHUB_OUTPUT - cat changes.txt >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - - name: Find Comment - uses: peter-evans/find-comment@v2 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: API Changes - - - name: Create or update comment - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - API Changes - ```diff - ${{ steps.api-check.outputs.diff-output || 'none detected' }} - ``` - edit-mode: replace diff --git a/.taskfiles/godoc/Taskfile.yml b/.taskfiles/godoc/Taskfile.yml deleted file mode 100644 index 3f8efe5bc0ad..000000000000 --- a/.taskfiles/godoc/Taskfile.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -version: "3" - -tasks: - default: - desc: "Run godoc on all packages" - dir: ../.. - vars: - package: - sh: go mod edit -json | jq .Module.Path -r - packages: - sh: go list ./... | sed -e 's|{{.package}}|.|g' - silent: true - cmds: - - | - set -e; - {{- range $i, $package := .packages | splitLines -}} - echo -e "# Package: {{ $package }}\n" - go doc -all {{ $package }} || true - {{ end -}}