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

Investigate why GH Action commenter is failing on 3rd party request #24

Open
tehcyx opened this issue Nov 22, 2022 · 1 comment
Open

Comments

@tehcyx
Copy link
Owner

tehcyx commented Nov 22, 2022

Commenter failed here #23 with a 403 error:

Run actions/github-script@v3
  with:
    github-token: ***
    script: var fs = require('fs');
  const ev = JSON.parse(
    fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')
  )
  var issue_number = ev.pull_request.number
  await github.issues.createComment({
    owner: context.repo.owner,
    repo: context.repo.repo,
    issue_number: issue_number,
    body: 'Thank you for the PR! A maintainer will have to add the `ok-to-test` label to run tests before this can get merged.'
  });
  
    debug: false
    user-agent: actions/github-script
    result-encoding: json
RequestError [HttpError]: Resource not accessible by integration
Error: Unhandled error: HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/actions/github-script/v3/dist/index.js:[2](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:2)[3](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:3)[4](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:4)2:23
    at processTicksAndRejections (internal/process/task_queues.js:97:[5](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:5))
    at async eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:[6](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:6)120:56), <anonymous>:6:1)
    at async main (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:614[7](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:7):20) {
  status: 403,
  headers: {
    'access-control-allow-origin': '*',
    'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
    connection: 'close',
    'content-encoding': 'gzip',
    'content-security-policy': "default-src 'none'",
    'content-type': 'application/json; charset=utf-[8](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:8)',
    date: 'Tue, 22 Nov 2022 1[9](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:9):30:21 GMT',
    'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
    server: 'GitHub.com',
    'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
    'transfer-encoding': 'chunked',
    vary: 'Accept-Encoding, Accept, X-Requested-With',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'deny',
    'x-github-media-type': 'github.v3',
    'x-github-request-id': '0400:117B:2F36FB4:604833D:637D234D',
    'x-ratelimit-limit': '[10](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:10)00',
    'x-ratelimit-remaining': '999',
    'x-ratelimit-reset': '1669149021',
    'x-ratelimit-resource': 'core',
    'x-ratelimit-used': '1',
    'x-xss-protection': '0'
  },
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/tehcyx/terraform-provider-kind/issues/23/comments',
    headers: {
      accept: 'application/vnd.github.-preview+json',
      'user-agent': 'actions/github-script octokit-core.js/3.2.1 Node.js/[12](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:12).[22](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:23).7 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"body":"Thank you for the PR! A maintainer will have to add the `ok-to-test` label to run tests before this can get merged."}',
    request: { agent: [Agent], hook: [Function: bound bound register] }
  },
  documentation_url: 'https://docs.github.com/rest/reference/issues#create-an-issue-comment'
}
@tehcyx
Copy link
Owner Author

tehcyx commented May 18, 2023

Possible fix in commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant