From a9d4a1a80231fa60d05e5b472ab2deb0f1fd90d6 Mon Sep 17 00:00:00 2001 From: reda Date: Wed, 20 Dec 2023 10:46:53 -0500 Subject: [PATCH] issue #4: reusable workflow add and commit --- .../workflows/workflow-lint-test-python.yml | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/workflow-lint-test-python.yml b/.github/workflows/workflow-lint-test-python.yml index 88f02af..6e8aa08 100644 --- a/.github/workflows/workflow-lint-test-python.yml +++ b/.github/workflows/workflow-lint-test-python.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 @@ -85,16 +85,22 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - name: Print for debug - run: echo "${{ env.GIT_BRANCH_NAME }}" + # - name: Push new file + # if: steps.compare_values.outputs.update_value == 'true' + # run: | + # git config --local user.email "actions@github.com" + # git config --local user.name "GitHub Actions" + # git add .github/workflows/gcp-deployment.yml + # git commit -m "Update threshold" + # git push + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Push new file + - name: Commit changes if: steps.compare_values.outputs.update_value == 'true' - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - git add .github/workflows/gcp-deployment.yml - git commit -m "Update threshold" - git push - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: EndBug/add-and-commit@v9 + with: + author_name: GitHub Actions Bot + author_email: actions@github.com + message: 'Update threshold' + add: '.github/workflows/gcp-deployment.yml'