Skip to content

test: probe whether GITHUB_TOKEN bypasses rulesets #1

test: probe whether GITHUB_TOKEN bypasses rulesets

test: probe whether GITHUB_TOKEN bypasses rulesets #1

name: Protection Probe
on:
push:
branches: [chore/probe-workflow]
permissions:
contents: write
jobs:
probe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: protection-probe
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Attempt bot push to ruleset-protected branch
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
echo "bot probe $(date -u +%s)" >> .probe-tmp.txt
git add .probe-tmp.txt
git commit -m "test: bot push probe"
echo "=====BOT_PUSH_BEGIN====="
if git push origin HEAD:protection-probe 2>&1; then
echo "=====BOT_PUSH_RESULT: ALLOWED====="
else
echo "=====BOT_PUSH_RESULT: REFUSED====="
fi