diff --git a/.github/workflows/update_api.yml b/.github/workflows/update_api.yml index 03fd49c6..58deb8af 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: "30 19 * * *" + - cron: "30 3 * * *" jobs: update-api: if: ${{ github.repository == 'saimedhi/opensearch-py' }} @@ -26,6 +26,13 @@ jobs: python3.7 -m pip install nox - name: Generate API run: nox -s generate + - name: Update CHANGELOG + uses: jacobtomlinson/gha-find-replace@v3 + if: ${{ steps.cpr.outputs.pull-request-number != '' }} + with: + find: "- Your contribution here." + 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: Get current date id: date run: echo "::set-output name=date::$(date +'%Y-%m-%d')" @@ -49,22 +56,4 @@ jobs: base: main signoff: true labels: | - autocut - - name: Check out update branch - if: ${{ steps.cpr.outputs.pull-request-number != '' }} - run: | - git fetch origin automated-api-update - git checkout automated-api-update - - name: Update CHANGELOG - uses: jacobtomlinson/gha-find-replace@v3 - if: ${{ steps.cpr.outputs.pull-request-number != '' }} - with: - find: "- Your contribution here." - 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 - 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 + autocut \ No newline at end of file