From 6713be3e0131b2b9792091251eff9b08a036bdbf Mon Sep 17 00:00:00 2001 From: Sai Medhini Reddy Maryada Date: Thu, 1 Feb 2024 17:45:18 -0800 Subject: [PATCH] updated Signed-off-by: Sai Medhini Reddy Maryada --- .github/workflows/update_api.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/update_api.yml b/.github/workflows/update_api.yml index 1f724930..55a29446 100644 --- a/.github/workflows/update_api.yml +++ b/.github/workflows/update_api.yml @@ -2,7 +2,7 @@ name: Update API on: workflow_dispatch: schedule: - - cron: "55 6 * * *" + - cron: "30 3 * * *" jobs: update-api: if: ${{ github.repository == 'saimedhi/opensearch-py' }} @@ -30,17 +30,17 @@ jobs: id: date run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - name: GitHub App token - if: ${{ github.repository == 'saimedhi/opensearch-py' }} +if: ${{ github.repository == 'saimedhi/opensearch-py' }} id: github_app_token uses: tibdex/github-app-token@v2.1.0 with: app_id: ${{ secrets.CI_APP_ID }} private_key: ${{ secrets.CI_APP_PRIVATE_KEY }} - - name: Create pull request + - name: Create pull request id: cpr uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ steps.github_app_token.outputs.token }} commit-message: Updated opensearch-py to reflect the latest OpenSearch API spec (${{ steps.date.outputs.date }}) title: Updated opensearch-py to reflect the latest OpenSearch API spec body: | @@ -48,8 +48,9 @@ jobs: Date: ${{ steps.date.outputs.date }} branch: automated-api-update base: main - committer: opensearchpy-api-update-bot - author: opensearchpy-api-update-bot + signoff: true + labels: | + autocut - name: Check out update branch if: ${{ steps.cpr.outputs.pull-request-number != '' }} run: | @@ -63,15 +64,8 @@ jobs: replace: "- Updated opensearch-py to reflect the latest OpenSearch API spec ([#${{steps.cpr.outputs.pull-request-number}}](https://github.com/saimedhi/opensearch-py/pull/${{steps.cpr.outputs.pull-request-number}}))\n- Your contribution here." include: "**CHANGELOG.md" - name: Commit and Push - if: ${{ steps.cpr.outputs.pull-request-number != '' }} - run: | - git config --local user.name 'opensearchpy-api-update-bot' - git config --local user.email 'noreply@github.com' - git config --local --unset-all http.https://github.com/.extraheader || true - AUTH=$(echo -n "x-access-token:${{ steps.github_app_token.outputs.token || secrets.GITHUB_TOKEN }}" | base64) - echo "::add-mask::${AUTH}" - git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${AUTH}" - git add CHANGELOG.md - git commit --amend --no-edit - git push origin automated-api-update -f - \ No newline at end of file + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Update changelog" + branch: automated-api-update + commit_options: '--signoff' \ No newline at end of file