From 008d5f2d35535186542ce7770ddae9ad92e2541e Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 9 Aug 2022 13:11:49 +0200 Subject: [PATCH 1/2] Add gorelease GitHub Action task --- .github/workflows/gorelease.yml | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/gorelease.yml diff --git a/.github/workflows/gorelease.yml b/.github/workflows/gorelease.yml new file mode 100644 index 00000000..ff26caae --- /dev/null +++ b/.github/workflows/gorelease.yml @@ -0,0 +1,48 @@ +# Gorelease comments public API changes to pull request. +name: gorelease +on: + pull_request: + +# Cancel the workflow in progress in newer build is about to start. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + GO_VERSION: 1.19.x +jobs: + gorelease: + runs-on: ubuntu-latest + steps: + - name: Install Go stable + if: env.GO_VERSION != 'tip' + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Gorelease cache + uses: actions/cache@v2 + with: + path: | + ~/go/bin/gorelease + key: ${{ runner.os }}-gorelease-generic + - name: Gorelease + id: gorelease + run: | + test -e ~/go/bin/gorelease || go install golang.org/x/exp/cmd/gorelease@latest + OUTPUT=$(gorelease 2>&1 || exit 0) + echo "${OUTPUT}" + OUTPUT="${OUTPUT//$'\n'/%0A}" + echo "::set-output name=report::$OUTPUT" + - name: Comment Report + continue-on-error: true + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: gorelease + message: | + ### Go API Changes + +
+            ${{ steps.gorelease.outputs.report }}
+            
\ No newline at end of file From 344676c0a637c3d7d9c99babe7f93ca9907c727f Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 9 Aug 2022 16:39:02 +0200 Subject: [PATCH 2/2] Update .github/workflows/gorelease.yml Co-authored-by: Nhat --- .github/workflows/gorelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gorelease.yml b/.github/workflows/gorelease.yml index ff26caae..69fced9f 100644 --- a/.github/workflows/gorelease.yml +++ b/.github/workflows/gorelease.yml @@ -45,4 +45,4 @@ jobs:
             ${{ steps.gorelease.outputs.report }}
-            
\ No newline at end of file +