From 938593d5f5e80c67e7dc495e9f7c6739b52ee1b3 Mon Sep 17 00:00:00 2001 From: Sander Blue Date: Tue, 24 Sep 2024 16:02:10 -0500 Subject: [PATCH] chore(automation): attempt to create the first automated PR for codegen --- .github/workflows/generate.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index e8185b27..a3d77a4b 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -49,7 +49,7 @@ jobs: run: go install github.com/newrelic/tutone/cmd/tutone@latest - name: Echo stuff for a testing purposes - run: echo "${{ inputs.packages }}" + run: echo "${{ inputs.packages }}" && echo "Branch Name - ${{ github.ref_name }}" shell: bash # TODO: Append configuration to the config file OR write temporary Tutone config file? @@ -68,22 +68,20 @@ jobs: env: NEW_RELIC_API_KEY: ${{ secrets.NEW_RELIC_API_KEY }} - - name: Commit and push changes + - name: Create new branch, commit, and push changes run: | + git checkout -b automation/generated-code git add pkg git commit --no-verify -m 'feat(codegen): generate code based on latest API changes' - git push origin HEAD:${{ github.ref_name }} + git push origin automation/generated-code - # git commit --no-verify -m "chore(release): release v${VER_NEXT}" - # git push --no-verify origin HEAD:${DEFAULT_BRANCH} - - - name: Create Pull Request + - name: Create pull request uses: peter-evans/create-pull-request@v3 with: token: ${{ secrets.DEV_TOOLKIT_TOKEN }} commit-message: 'chore(tutone): update generated code' signoff: false - branch: feat/generated-code + branch: automation/generated-code title: 'feat(codegen): generate code based on latest API changes' body: | Update generated code using Tutone