feat: initial implementation #5
					 4 changed files with 32 additions and 24 deletions
				
			
		
				commit
				
					
					
						72b5dd18f3
					
				
			
		|  | @ -7,8 +7,6 @@ jobs: | |||
|   lint: | ||||
|     name: Lint Pr Title | ||||
|     runs-on: ubuntu-latest | ||||
|     container: | ||||
|       image: golang | ||||
| 
 | ||||
|     steps: | ||||
|       - name: Install go | ||||
|  | @ -17,5 +15,4 @@ jobs: | |||
|           go-version: 1.24.2 | ||||
| 
 | ||||
|       - name: Run Pull Request Lint Action | ||||
|         if: ${{ always() }} | ||||
|         uses: https://git.kjan.de/actions/pull-request-lint@main | ||||
|  |  | |||
|  | @ -1,19 +0,0 @@ | |||
| name: 'Test Go Action' | ||||
| on: [push] | ||||
| jobs: | ||||
|   use-go-action: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Setup Go | ||||
|         uses: actions/setup-go@v3 | ||||
|         with: | ||||
|           go-version: '1.20' | ||||
| 
 | ||||
|       - name: Use Go Action   | ||||
|         id: use-go-action | ||||
|         uses: https://gitea.com/Zettat123/simple-go-action@v1 | ||||
|         with: | ||||
|           username: foo | ||||
| 
 | ||||
|       - name: Print Output | ||||
|         run: echo 'output time is ${{ steps.use-go-action.outputs.time }}' | ||||
|  | @ -1,5 +1,5 @@ | |||
| name: 'Pull Request Lint' | ||||
| description: 'Validates a pull request for semantical commit message' | ||||
| runs: | ||||
|   using: 'go' | ||||
|   main: 'main.go' | ||||
|   using: 'node16' | ||||
|   main: 'invoke-binary.js' | ||||
|  |  | |||
							
								
								
									
										30
									
								
								invoke-binary.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								invoke-binary.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,30 @@ | |||
| const childProcess = require('child_process') | ||||
| const path = require('path') | ||||
| 
 | ||||
| function runGo() { | ||||
|     const goProcess = childProcess.spawnSync( | ||||
|         'go', | ||||
|         ['run', '.'], | ||||
|         { | ||||
|             cwd: __dirname, | ||||
|             stdio: 'inherit', | ||||
|             shell: true, | ||||
|         }, | ||||
|     ) | ||||
| 
 | ||||
|     if (goProcess.error) { | ||||
|         console.error('Failed to execute `go run .`:', goProcess.error) | ||||
|         process.exit(1) | ||||
|     } | ||||
| 
 | ||||
|     if (goProcess.status !== 0) { | ||||
|         console.error( | ||||
|             '`go run .` exited with code', | ||||
|             goProcess.status, | ||||
|             goProcess.stderr ? goProcess.stderr.toString() : '', | ||||
|         ) | ||||
|         process.exit(goProcess.status) | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| runGo() | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue