我试图推送操作中所做的更改,但它总是抛出错误。 我已经尝试使用具有所有权限的令牌,但它仍然不起作用。
这是我在 github atcions 中的内容:
- name: Commit and push changes
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
git config --global user.name "Polareti"
git config --global user.email "[email protected]"
git add Investimentos.xlsx
git commit -m "Atualizar arquivo com novos valores [skip ci]"
git remote set-url origin https://github.com/Polareti/Excel-Automation.git
git push origin main
我能够使用此代码提交并推送
name: Commit and push
on:
workflow_dispatch
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
date > generated.txt
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "generated"
git push