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 1, 2024
1 parent 88a69c2 commit d494e75
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/update_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ jobs:
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: |
Updated [opensearch-py](https://github.com/opensearch-project/opensearch-py) to reflect the latest [OpenSearch API spec](https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json)
Date: ${{ steps.date.outputs.date }}
branch: automated-api-update
base: main
committer: opensearchpy-api-update-bot <[email protected]>
author: opensearchpy-api-update-bot <[email protected]>
signoff: true
labels: |
autocut
- name: Check out update branch
if: ${{ steps.cpr.outputs.pull-request-number != '' }}
run: |
Expand All @@ -63,14 +64,8 @@ jobs:
replace: "- Updated opensearch-py to reflect the latest OpenSearch API spec ([#${{steps.cpr.outputs.pull-request-number}}](https://github.com/opensearch-project/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 '[email protected]'
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
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update changelog"
branch: automated-api-update
commit_options: '--signoff'

0 comments on commit d494e75

Please sign in to comment.