Skip to content

Commit

Permalink
change git auth in wf
Browse files Browse the repository at this point in the history
  • Loading branch information
akyriako committed Jul 11, 2024
1 parent 3b82c02 commit 7138622
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,35 @@ jobs:
needs: [build-app, build-push-docker]
environment: preview
runs-on: ubuntu-latest
env:
CHARTS_REPO: 'docs-next-charts'
CHARTS_ORG: 'akyriako'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'akyriako/docs-next-charts'

- name: Show Contents
run: ls -latr

- name: Get Commit Hash
id: commit_hash
uses: prompt/actions-commit-hash@v3

- name: Show Commit Hash Digest
run: echo ${{ steps.commit_hash.outputs.short }}

- name: Set GitHub Actions Bot Credentials
id: set_bot_creds
uses: rindeal/action-git-config-user@v1
# - name: Set GitHub Actions Bot Credentials
# id: set_bot_creds
# uses: rindeal/action-git-config-user@v1

- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Checkout
uses: actions/checkout@v4
with:
repository: "${{ env.CHARTS_ORG }}/${{ env.CHARTS_REPO }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Show Contents
run: ls -latr

- name: Update Charts
id: update_charts
Expand All @@ -100,6 +110,7 @@ jobs:
sed -i 's/^version: .*/version: ${{ vars.APP_VERSION }}.${{github.run_number}}/' ./charts/typesense/Chart.yaml
sed -i 's/^appVersion: .*/appVersion: ${{ vars.APP_VERSION }}.${{github.run_number}}-${{ steps.commit_hash.outputs.short }}/' ./charts/typesense/Chart.yaml
git commit -am "Automatic commit from GitHub Actions triggered by action #${{github.run_number}}"
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ env.CHARTS_ORG }}/${{ env.CHARTS_REPO }}.git
git push origin main
Expand Down

0 comments on commit 7138622

Please sign in to comment.