Skip to content

Commit 221d197

Browse files
authored
Merge pull request #32 from project-codeguard/feature/update-actions-to-bypass-protection
added ability to bypass branch protection in actions
2 parents 93302a4 + 84b36e8 commit 221d197

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21+
- name: Generate GitHub App Token
22+
id: generate-token
23+
uses: actions/create-github-app-token@v1
24+
with:
25+
app-id: ${{ secrets.CODEGUARD_APP_ID }}
26+
private-key: ${{ secrets.CODEGUARD_APP_PRIVATE_KEY }}
27+
2128
- name: Checkout repository
2229
uses: actions/checkout@v4
2330
with:
2431
fetch-depth: 0
32+
token: ${{ steps.generate-token.outputs.token }}
2533

2634
- name: Install uv
2735
uses: astral-sh/setup-uv@v4
@@ -42,5 +50,7 @@ jobs:
4250
git config --local user.name "github-actions[bot]"
4351
4452
- name: Deploy to GitHub Pages
53+
env:
54+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
4555
run: uv run mkdocs gh-deploy --force --clean --verbose
4656

.github/workflows/generate-ide-rules.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,21 @@ jobs:
1616
runs-on: ubuntu-latest
1717
permissions:
1818
contents: write
19+
pull-requests: write
1920

2021
steps:
22+
- name: Generate GitHub App Token
23+
id: generate-token
24+
uses: actions/create-github-app-token@v1
25+
with:
26+
app-id: ${{ secrets.CODEGUARD_APP_ID }}
27+
private-key: ${{ secrets.CODEGUARD_APP_PRIVATE_KEY }}
28+
2129
- name: Checkout repository
2230
uses: actions/checkout@v4
2331
with:
2432
fetch-depth: 0
33+
token: ${{ steps.generate-token.outputs.token }}
2534

2635
- name: Install uv
2736
uses: astral-sh/setup-uv@v4
@@ -50,6 +59,8 @@ jobs:
5059
5160
- name: Commit and push generated rules
5261
if: steps.check_changes.outputs.changes == 'true'
62+
env:
63+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
5364
run: |
5465
git config --local user.email "github-actions[bot]@users.noreply.github.com"
5566
git config --local user.name "github-actions[bot]"

0 commit comments

Comments
 (0)