EndBug / add-and-commit

:octocat: Automatically commit changes made in your workflow run directly to your repo
MIT License
1.15k stars 117 forks source link

Permission error when using the action #658

Closed a0m0rajab closed 3 months ago

a0m0rajab commented 3 months ago

Describe the bug A clear and concise description of what the bug is. If a particular error is shown I tried to use this action to lint and commit changes to pull requests on a repo yet I got a permission error when I tried it, I have tried to use the pull-request-target-head.ref as mentioned in the docs but still got lost with that:

Workflow used The workflow file: https://github.com/ayasofyazilim-clomerce/ayasofyazilim-core-project/actions/runs/10263188226/workflow?pr=465

Expected behavior

I was expecting the action to run on the pull request and push the changes.

Logs

Here is the action: https://github.com/ayasofyazilim-clomerce/ayasofyazilim-core-project/actions/runs/10263188226/job/28394446958?pr=465

EndBug commented 3 months ago

You need to set contents: write, otherwise the token won't be authorized to push to the repo ;)

a0m0rajab commented 3 months ago

@EndBug Thanks for the information, I miss understood the pull request permission (thought it allows the action to write on the content of pull request and was thinking about the content as something to allow to write on the pull request body) Needed to read the docs :)

Thanks again!