yuzutech / annotations-action

GitHub action to create annotations from a JSON file
MIT License
31 stars 15 forks source link

Add permissions required to README.md #64

Closed francorbacho closed 8 months ago

francorbacho commented 8 months ago

This was pretty confusing to me, and it looks like obvious information to provide to new users.

ggrossetie commented 8 months ago

I didn't know it was needed. Were did you configure this setting?

francorbacho commented 8 months ago

It was failing for me (at least on private repos) with an authorization error without it. It was all configured in the job.yml file like so:

name: Foo

on:
  push:
  pull_request:

jobs:
  run-job:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      checks: write
    steps:
      - ...
ggrossetie commented 8 months ago

I found an explanation at: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

You are probably using a "restricted" GITHUB_TOKEN as mentioned in: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

I think we should explain when it's needed and why it's needed. As far as I understand, it's only needed when using a "restricted" GITHUB_TOKEN.

Do you have the authorization error message? It might also help others to troubleshoot if we copy/paste the error message next to the solution.

Thanks!

francorbacho commented 8 months ago

I don't know why I have a restricted access GITHUB_TOKEN, I don't think I configured it anywhere.

Anyhow, I have included the information you requested. Feel free to rearrange the information as you wish.

ggrossetie commented 8 months ago

@francorbacho That's great, thank you! I made tiny updates. Thanks again for taking the time to help others 🤗