Skip to content

Commit

Permalink
Update cmd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mordamax committed Jan 20, 2025
1 parent 68e885c commit 1fcd6ba
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,16 @@ jobs:
echo "$CMD_OUTPUT" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
fi
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CMD_BOT_APP_ID }}
private-key: ${{ secrets.CMD_BOT_APP_KEY }}

- name: Commit changes
run: |
git status
if [ -n "$(git status --porcelain)" ]; then
Expand All @@ -325,7 +334,7 @@ jobs:
# Push the results to the target branch
git remote add \
github \
"https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ needs.get-pr-info.outputs.repo }}.git" || :
"https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/${{ needs.get-pr-info.outputs.repo }}.git" || :
push_changes() {
git push github "HEAD:$PR_BRANCH"
Expand All @@ -342,6 +351,8 @@ jobs:
# After successful rebase, try pushing again
push_changes
fi
git remote remove github || :
else
echo "Nothing to commit";
fi
Expand Down

0 comments on commit 1fcd6ba

Please sign in to comment.