Skip to content

Grant write permissions in test-auto-create workflow #6

Grant write permissions in test-auto-create workflow

Grant write permissions in test-auto-create workflow #6

name: Test Auto Directory Creation
on:
workflow_dispatch:
push:
branches: [ "main" ]
jobs:
test-create:
runs-on: ubuntu-latest
permissions:
contents: write # 👈 关键!授予写权限
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Run simple creation script
run: python .github/scripts/create_dirs.py
- name: Commit and push if changes
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add .
git diff --staged --quiet || git commit -m "✅ Test: Auto-created directories"
git push