Skip to content

Commit

Permalink
Added an automated api update bot for opensearch-py
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Feb 2, 2024
1 parent 9f92fda commit ad9d1af
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/update_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand All @@ -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')"
Expand All @@ -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'
autocut

0 comments on commit ad9d1af

Please sign in to comment.