Create Go Package #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |