-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (49 loc) · 1.53 KB
/
create_go_package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Create Go Package
on:
pull_request:
types:
- closed
branches:
- 'main'
paths:
- 'go/**'
jobs:
create_go_package_and_push:
name: Create Go package and push
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main
- name: Define global config git
run: |
git config --global user.name "Github Actions"
git config --global user.email "[email protected]"
- name: Zip Go files
run: |
zip -r ../go.zip go
- name: Move zip Go file to workspace
run: |
mv ../go.zip .
- name: Push zip Go file to new branch
run: |
git add go.zip
git commit -am "Added new Go package: '${{ github.event.pull_request.title }}'"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
base: main
branch: feature/go-pr_${{ github.event.pull_request.number }}-${{ github.event.created_at }}
branch-suffix: timestamp
committer: 'Github Actions <[email protected]>'
author: 'Github Actions <[email protected]>'
title: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
labels: |
go
automated pr