update workflows
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
		
							
								
								
									
										20
									
								
								.github/workflows/autoapprove.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.github/workflows/autoapprove.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -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 }} | ||||
							
								
								
									
										21
									
								
								.github/workflows/automerge.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								.github/workflows/automerge.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -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}} | ||||
							
								
								
									
										5
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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,7 +32,7 @@ jobs: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: checkout | ||||
|         uses: actions/checkout@v2 | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: lint | ||||
|         uses: golangci/golangci-lint-action@v3.1.0 | ||||
|         continue-on-error: true | ||||
|   | ||||
							
								
								
									
										2
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							| @@ -43,7 +43,7 @@ jobs: | ||||
|  | ||||
|     steps: | ||||
|     - name: checkout | ||||
|       uses: actions/checkout@v2 | ||||
|       uses: actions/checkout@v3 | ||||
|     - name: setup | ||||
|       uses: actions/setup-go@v2 | ||||
|       with: | ||||
|   | ||||
							
								
								
									
										14
									
								
								.github/workflows/dependabot-automerge.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/dependabot-automerge.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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: | ||||
|   | ||||
							
								
								
									
										5
									
								
								.github/workflows/pr.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/workflows/pr.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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,7 +32,7 @@ jobs: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: checkout | ||||
|         uses: actions/checkout@v2 | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: lint | ||||
|         uses: golangci/golangci-lint-action@v3.1.0 | ||||
|         continue-on-error: true | ||||
|   | ||||
							
								
								
									
										8
									
								
								http.go
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								http.go
									
									
									
									
									
								
							| @@ -184,6 +184,14 @@ func (h *httpServer) NewHandler(handler interface{}, opts ...server.HandlerOptio | ||||
|  | ||||
| 	tp := reflect.TypeOf(handler) | ||||
|  | ||||
| 	if len(options.Metadata) == 0 { | ||||
| 		if h.registerRPC { | ||||
| 			h.opts.Logger.Infof(h.opts.Context, "register rpc handler for http.MethodPost %s /%s", hn, hn) | ||||
| 			if err := hdlr.handlers.Insert([]string{http.MethodPost}, "/"+hn, pth); err != nil { | ||||
| 				h.opts.Logger.Errorf(h.opts.Context, "cant add rpc handler for http.MethodPost %s /%s", hn, hn) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	for hn, md := range options.Metadata { | ||||
| 		var method reflect.Method | ||||
| 		mname := hn[strings.Index(hn, ".")+1:] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user