Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting started not working #49

Open
fabn opened this issue Nov 7, 2024 · 3 comments
Open

Getting started not working #49

fabn opened this issue Nov 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@fabn
Copy link

fabn commented Nov 7, 2024

Describe the Issue

I'm trying this action in an empty repository and I'm not able to make it working. It says something about missing permissions but it's not specifying which one is missing.

I put the attached workflow in main branch, then I opened a pull request and commented it with

.ping | LOG_LEVEL=debug,CPU_CORES=4

Action Configuration

name: "command demo"

# the workflow to execute on is comments that are newly created
on:
  issue_comment:
    types: [ created ]

# permissions needed for reacting to IssueOps commands on issues and PRs
permissions:
  pull-requests: write
  issues: write
  checks: read

jobs:
  demo:
    runs-on: ubuntu-latest
    steps:
      # execute IssueOps command logic, hooray!
      # this will be used to "gate" all future steps below
      - uses: github/command@v1.2.2
        id: ping
        with:
          command: ".ping"

      # run your custom logic for your project here - example seen below

      # conditionally run some logic here
      - name: ping command
        if: ${{ steps.ping.outputs.continue == 'true' }}
        run: echo 'Got comment in PR \#${{ steps.ping.outputs.issue_number }} with params ${{ steps.ping.outputs.params }}'

Relevant Actions Log Output

Run github/command@v1.2.2
##[debug]checking if the context of 'issue_comment' is valid
🧮 detected parameters in command: LOG_LEVEL=debug,CPU_CORES=4
##[debug]raw allowlist value: false
##[debug]no allowlist provided, all users are allowed
Error: GraphqlResponseError: Request failed due to following response errors:
 - Resource not accessible by integration
    at /home/runner/work/_actions/github/command/v1.2.2/node_modules/@octokit/graphql/dist-node/index.js:113:1
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at prechecks (/home/runner/work/_actions/github/command/v1.2.2/src/functions/prechecks.js:129:1)
    at run (/home/runner/work/_actions/github/command/v1.2.2/src/main.js:78:1)
Error: Request failed due to following response errors:
 - Resource not accessible by integration

Extra Information

It would be very useful if the action uses some core.debug calls in its codebase to better track issues like this one. At the moment even with debug mode there is no output from the action itself.

@fabn fabn added the bug Something isn't working label Nov 7, 2024
@GrantBirki
Copy link
Member

Using this exact yaml:

name: "command demo"

# the workflow to execute on is comments that are newly created
on:
  issue_comment:
    types: [ created ]

# permissions needed for reacting to IssueOps commands on issues and PRs
permissions:
  pull-requests: write
  issues: write
  checks: read

jobs:
  demo:
    runs-on: ubuntu-latest
    steps:
      # execute IssueOps command logic, hooray!
      # this will be used to "gate" all future steps below
      - uses: github/command@main
        id: ping
        with:
          command: ".ping"

      # run your custom logic for your project here - example seen below

      # conditionally run some logic here
      - name: ping command
        if: ${{ steps.ping.outputs.continue == 'true' }}
        run: echo 'Got comment in PR \#${{ steps.ping.outputs.issue_number }} with params ${{ steps.ping.outputs.params }}'

Commenting on this pull request: GrantBirki/actions-sandbox#127 (comment)

I get results that are expected: https://github.com/GrantBirki/actions-sandbox/actions/runs/12291435545/job/34300203115

Image

I'm not sure why you are getting that error but it is almost always related to your workflow not having the correct permissions block (or a bug in my code).

@fabn
Copy link
Author

fabn commented Dec 12, 2024

I moved to branch deploy so didn't tried (nor debugged this) however I'll run it again to confirm or close the issue.

In any case the AI pull request is not so bad 😉

@shikanime
Copy link

I made it work by adding the contents: read permission while playing with github/branch-deploy, it explicitly mentioned it in the errors compared to command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@fabn @shikanime @GrantBirki and others