From c076d4db949502afa9a59cb3e53b06bcaf66fe26 Mon Sep 17 00:00:00 2001 From: Sashwat K Date: Fri, 14 Jun 2024 22:23:57 +0530 Subject: [PATCH] fix: github actions issue --- .github/workflows/update_go_modules.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_go_modules.yml b/.github/workflows/update_go_modules.yml index 7e15742..db854d0 100644 --- a/.github/workflows/update_go_modules.yml +++ b/.github/workflows/update_go_modules.yml @@ -1,9 +1,6 @@ name: Update Go Modules on: - push: - branches: - - main schedule: - cron: '0 0 * * *' # Runs every day at midnight workflow_dispatch: # Allows manual triggering of the workflow @@ -79,6 +76,7 @@ jobs: BRANCH_NAME="update-go-modules-$TIMESTAMP" git checkout -b $BRANCH_NAME git add go.mod go.sum + git diff --name-only --cached git commit -m "Update Go modules and Go version to the latest version" git push --set-upstream origin $BRANCH_NAME echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV @@ -98,6 +96,11 @@ jobs: if [ "${{ env.GO_VERSION_UPDATED }}" == "true" ]; then echo "Go version updated from ${{ env.CURRENT_GO_VERSION }} to ${{ env.LATEST_GO_VERSION }}" >> pr_body.md fi + cat pr_body.md + shell: bash + - name: Read PR body + id: read_pr_body + run: echo "PR_BODY=$(> $GITHUB_ENV - name: Create Pull Request if: env.exit_code == '1' @@ -108,5 +111,5 @@ jobs: branch: ${{ env.BRANCH_NAME }} base: main title: Update Go modules and Go version - body: file://pr_body.md + body: ${{ env.PR_BODY }} labels: go-modules, automated-update