Skip to content

Commit c4818f2

Browse files
committed
ci: fix Format code workflow
1 parent 6ed7ac8 commit c4818f2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/format-code.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ jobs:
1313
name: Format code
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Generate a token
17+
id: generate_token
18+
uses: actions/[email protected]
19+
with:
20+
app-id: ${{ secrets.CONTINUOUS_INTEGRATION_BOT_ID }}
21+
private-key: ${{ secrets.CONTINUOUS_INTEGRATION_BOT_KEY }}
22+
1623
- name: Checkout repository
1724
uses: actions/checkout@v4
25+
with:
26+
token: ${{ steps.generate_token.outputs.token }}
1827

1928
- name: Install clang-format (formatter tool)
2029
run: sudo apt-get install clang-format
@@ -24,13 +33,6 @@ jobs:
2433

2534
- name: Commit changes
2635
run: |
27-
git config --global user.name 'github-actions[bot]'
28-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
2936
git add .
3037
git diff-index --quiet HEAD || git commit -m "ci: format code"
31-
32-
- name: Push changes
33-
uses: ad-m/[email protected]
34-
with:
35-
branch: ${{ github.ref }}
36-
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
git push

0 commit comments

Comments
 (0)