From e1824d489f4f036929a14a3207be3683fb6c5684 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 5 Mar 2022 19:09:05 +0300 Subject: [PATCH] update workflows Signed-off-by: Vasiliy Tolstov --- .github/workflows/autoapprove.yml | 20 ++++++++++++++++++++ .github/workflows/automerge.yml | 21 +++++++++++++++++++++ .github/workflows/build.yml | 7 ++++--- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/dependabot-automerge.yml | 14 +++++--------- .github/workflows/pr.yml | 7 ++++--- 6 files changed, 55 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/autoapprove.yml create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/autoapprove.yml b/.github/workflows/autoapprove.yml new file mode 100644 index 0000000..ebe28c9 --- /dev/null +++ b/.github/workflows/autoapprove.yml @@ -0,0 +1,20 @@ +name: "autoapprove" + +on: + pull_request_target: + types: [assigned, opened, synchronize, reopened] + +permissions: + pull-requests: write + contents: write + +jobs: + autoapprove: + runs-on: ubuntu-latest + steps: + - name: approve + uses: hmarr/auto-approve-action@v2 + if: github.actor == 'vtolstov' || github.actor == 'dependabot[bot]' + id: approve + with: + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..5ff3f69 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,21 @@ +name: "automerge" + +on: + pull_request_target: + types: [assigned, opened, synchronize, reopened] + +permissions: + pull-requests: write + contents: write + +jobs: + automerge: + runs-on: ubuntu-latest + if: github.actor == 'vtolstov' + steps: + - name: merge + id: merge + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.TOKEN}} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4182c04..d8002e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ on: push: branches: - master + - v3 jobs: test: name: test @@ -13,7 +14,7 @@ jobs: with: go-version: 1.16 - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: cache uses: actions/cache@v2 with: @@ -31,9 +32,9 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v3.1.0 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b50aad2..9b4d428 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: setup uses: actions/setup-go@v2 with: diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 26cf8ca..3681028 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -1,4 +1,4 @@ -name: "prautomerge" +name: "dependabot-automerge" on: pull_request_target: @@ -9,21 +9,17 @@ permissions: contents: write jobs: - dependabot: + automerge: runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} + if: github.actor == 'dependabot[bot]' steps: - name: metadata id: metadata - uses: dependabot/fetch-metadata@v1.2.1 + uses: dependabot/fetch-metadata@v1.3.0 with: github-token: "${{ secrets.TOKEN }}" - - name: approve - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.TOKEN}} - name: merge + id: merge if: ${{contains(steps.metadata.outputs.dependency-names, 'go.unistack.org')}} run: gh pr merge --auto --merge "$PR_URL" env: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f807f24..ff10c46 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,6 +3,7 @@ on: pull_request: branches: - master + - v3 jobs: test: name: test @@ -13,7 +14,7 @@ jobs: with: go-version: 1.16 - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: cache uses: actions/cache@v2 with: @@ -31,9 +32,9 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v3.1.0 continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.