I am trying to push the changes that are made from the action, but it always throws an error. I already tried to use a token with all permissions, and it still doesn't work.
This is what i have in 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 "myemail@gmail.com"
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
I was able to commit and push with this code
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 github-actions@github.com
git add .
git commit -m "generated"
git push