From 3592052ac9f63d73f4e86e0cdd80234c79ec65f1 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 25 Oct 2021 20:35:02 +0300 Subject: [PATCH 1/4] guard import Signed-off-by: Vasiliy Tolstov --- http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http.go b/http.go index b9f6e88..5c14940 100644 --- a/http.go +++ b/http.go @@ -1,5 +1,5 @@ // Package http provides a http client -package http +package http // import "go.unistack.org/micro-client-http/v3" import ( "bufio" From 73b7d998c0b3db84d39434191e5aff884ce66aa2 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 27 Oct 2021 13:13:33 +0300 Subject: [PATCH 2/4] fix Header and Cookie fill Signed-off-by: Vasiliy Tolstov --- http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http.go b/http.go index 5c14940..8e843df 100644 --- a/http.go +++ b/http.go @@ -166,7 +166,7 @@ func newRequest(ctx context.Context, addr string, req client.Request, ct string, for km, vm := range parameters { for k, required := range vm { - v, err = rutil.StructFieldByPath(nmsg, k) + v, err = rutil.StructFieldByPath(msg, k) if err != nil { return nil, errors.BadRequest("go.micro.client", err.Error()) } From 22f1b6551a231e0fe73d6f137950fd77efe47d4a Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 27 Oct 2021 15:23:26 +0300 Subject: [PATCH 3/4] github automerge Signed-off-by: Vasiliy Tolstov --- .github/workflows/dependabot-automerge.yml | 70 +++++----------------- 1 file changed, 14 insertions(+), 56 deletions(-) diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 9715c32..aae8637 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -1,66 +1,24 @@ name: "prautomerge" -on: - workflow_run: - workflows: ["prbuild"] - types: - - completed +on: pull_request_target permissions: - contents: write pull-requests: write + contents: write jobs: - Dependabot-Automerge: + dependabot: runs-on: ubuntu-latest - # Contains workaround to execute if dependabot updates the PR by checking for the base branch in the linked PR - # The the github.event.workflow_run.event value is 'push' and not 'pull_request' - # dont work with multiple workflows when last returns success - if: >- - github.event.workflow_run.conclusion == 'success' - && github.actor == 'dependabot[bot]' - && github.event.sender.login == 'dependabot[bot]' - && github.event.sender.type == 'Bot' - && (github.event.workflow_run.event == 'pull_request' - || (github.event.workflow_run.event == 'push' && github.event.workflow_run.pull_requests[0].base.ref == github.event.repository.default_branch )) + if: ${{ github.actor == 'dependabot[bot]' }} steps: - - name: Approve Changes and Merge changes if label 'dependencies' is set - uses: actions/github-script@v4 + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1.1.1 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - console.log(context.payload.workflow_run); - - var labelNames = await github.paginate( - github.issues.listLabelsOnIssue, - { - repo: context.repo.repo, - owner: context.repo.owner, - issue_number: context.payload.workflow_run.pull_requests[0].number, - }, - (response) => response.data.map( - (label) => label.name - ) - ); - - console.log(labelNames); - - if (labelNames.includes('dependencies')) { - console.log('Found label'); - - await github.pulls.createReview({ - repo: context.repo.repo, - owner: context.repo.owner, - pull_number: context.payload.workflow_run.pull_requests[0].number, - event: 'APPROVE' - }); - console.log('Approved PR'); - - await github.pulls.merge({ - repo: context.repo.repo, - owner: context.repo.owner, - pull_number: context.payload.workflow_run.pull_requests[0].number, - }); - - console.log('Merged PR'); - } + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + if: ${{contains(steps.metadata.outputs.dependency-names, 'go.unistack.org')}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} From 61c082cb2f7251b36956304dd5b3bfcda36a3444 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 27 Oct 2021 15:24:55 +0300 Subject: [PATCH 4/4] github automerge Signed-off-by: Vasiliy Tolstov --- .github/workflows/build.yml | 1 + .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/pr.yml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb19b68..acebc1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ on: push: branches: - master + - v3 jobs: test: name: test diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index fa4081e..1227e50 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -17,10 +17,10 @@ on: types: - completed push: - branches: [ master ] + branches: [ master, v3 ] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [ master, v3 ] schedule: - cron: '34 1 * * 0' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 545baf2..8725616 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