Skip to content

Commit 587c1f3

Browse files
committed
test: probe whether GITHUB_TOKEN bypasses rulesets
Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent ed8dcd2 commit 587c1f3

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Protection Probe
2+
on:
3+
push:
4+
branches: [chore/probe-workflow]
5+
permissions:
6+
contents: write
7+
jobs:
8+
probe:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v7
12+
with:
13+
ref: protection-probe
14+
fetch-depth: 0
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
- name: Attempt bot push to ruleset-protected branch
17+
run: |
18+
git config user.name "github-actions[bot]"
19+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
20+
echo "bot probe $(date -u +%s)" >> .probe-tmp.txt
21+
git add .probe-tmp.txt
22+
git commit -m "test: bot push probe"
23+
echo "=====BOT_PUSH_BEGIN====="
24+
if git push origin HEAD:protection-probe 2>&1; then
25+
echo "=====BOT_PUSH_RESULT: ALLOWED====="
26+
else
27+
echo "=====BOT_PUSH_RESULT: REFUSED====="
28+
fi

0 commit comments

Comments
 (0)