Skip to content

Test Push

Test Push #2

Workflow file for this run

name: Test Push
on:
workflow_dispatch:
jobs:
test-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 创建测试文件
run: |
echo "test $(date)" > test.txt
- name: 配置 Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: 检查变更并提交
run: |
git add test.txt
git diff --cached --quiet || git commit -m "test: 测试自动推送权限"
- name: 推送变更
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}