Skip to content

Commit

Permalink
add another token generation step (#6941)
Browse files Browse the repository at this point in the history
Closes #6940
  • Loading branch information
mordamax authored Dec 18, 2024
1 parent d8df46c commit 586ab7f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@ jobs:
name: command-output
path: /tmp/cmd/command_output.log

# Generate token for commit, as the earlier token expires after 1 hour, while cmd can take longer
- name: Generate token for commit
uses: actions/create-github-app-token@v1
id: generate_token_commit
with:
app-id: ${{ secrets.CMD_BOT_APP_ID }}
private-key: ${{ secrets.CMD_BOT_APP_KEY }}

- name: Commit changes
run: |
if [ -n "$(git status --porcelain)" ]; then
Expand All @@ -410,7 +418,7 @@ jobs:
# Push the results to the target branch
git remote add \
github \
"https://token:${{ steps.generate_token.outputs.token }}@github.com/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}.git" || :
"https://token:${{ steps.generate_token_commit.outputs.token }}@github.com/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}.git" || :
push_changes() {
git push github "HEAD:${{ needs.get-pr-branch.outputs.pr-branch }}"
Expand Down

0 comments on commit 586ab7f

Please sign in to comment.