Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Medhini Reddy Maryada <[email protected]>
  • Loading branch information
Sai Medhini Reddy Maryada authored and Sai Medhini Reddy Maryada committed Jan 31, 2024
1 parent 7447a4c commit c604e14
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/update_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ jobs:
base: main
committer: opensearchpy-api-update-bot <[email protected]>
author: opensearchpy-api-update-bot <[email protected]>
- name: printed
- name: Check out update branch
if: ${{ steps.cpr.outputs.pull-request-number != '' }}
run: |
echo "Checking find pattern in CHANGELOG.md..."
grep -n "Your contribution here." CHANGELOG.md || echo "Pattern not found."
- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ steps.cpr.outputs.pull-request-number }}
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 != '' }}
Expand All @@ -65,22 +62,16 @@ jobs:
include: "**CHANGELOG.md"
- name: Commit and Push
if: ${{ steps.cpr.outputs.pull-request-number != '' }}
env:
token: ${{ secrets.GITHUB_TOKEN }}
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}"
add_output=$(git add CHANGELOG.md)
commit_output=$(git commit --amend --no-edit)
cat CHANGELOG.md
PUSH_OUTPUT=$(gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --squash --merge --auto)
echo "Git Add Output: $add_output"
echo "Git Commit Output: $commit_output"
echo "PUSHED_OUTPUT: $PUSH_OUTPUT"
git add CHANGELOG.md
git commit --amend --no-edit
git push origin automated-api-update -f
- name: List modified files for automated-api-update branch
run: |
branch_commit=$(git rev-parse automated-api-update)
Expand Down

0 comments on commit c604e14

Please sign in to comment.