Skip to content

Commit

Permalink
CI: Bypass push protection in autorelease.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jiribenes authored Sep 16, 2024
1 parent 19089d3 commit f0fc9ba
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,23 @@ jobs:
- name: Update Effekt version in NPM and MVN via sbt
run: sbt updateVersions

# Login as a GitHub App in order to bypass rules about committing to `master` directly
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.EFFEKT_UPDATER_GH_APP_ID }}
private-key: ${{ secrets.EFFEKT_UPDATER_GH_CREDENTIALS_TOKEN }}

- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Commit and push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions[bot]"
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
git add project/EffektVersion.scala
git add package.json
git add pom.xml
Expand Down

0 comments on commit f0fc9ba

Please sign in to comment.