peter-evans / create-or-update-comment

A GitHub action to create or update an issue or pull request comment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It don't work

ngimdock opened this issue · comments

I have this error in my github action steps console

Run peter-evans/create-or-update-comment@v3
/home/runner/work/_actions/peter-evans/create-or-update-comment/v3/dist/index.js:4690
const error = new requestError.RequestError(toErrorMessage(data), status, {
^

RequestError [HttpError]: Resource not accessible by integration
at /home/runner/work/_actions/peter-evans/create-or-update-comment/v3/dist/index.js:4690:21
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
status: 403,
response: {
url: 'https://api.github.com/repos/ngimdock/express-typescript-starter/issues/6/comments',
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',
date: 'Sat, 06 May 2023 04:37:34 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-api-version-selected': '2022-11-28',
'x-github-media-type': 'github.v3; format=json',
'x-github-request-id': '6C82:173A:19743B:353232:6455D98E',
'x-ratelimit-limit': '1000',
'x-ratelimit-remaining': '998',
'x-ratelimit-reset': '1683351219',
'x-ratelimit-resource': 'core',
'x-ratelimit-used': '2',
'x-xss-protection': '0'
},
data: {
message: 'Resource not accessible by integration',
documentation_url: 'https://docs.github.com/rest/reference/issues#create-an-issue-comment'
}
},
request: {
method: 'POST',
url: 'https://api.github.com/repos/ngimdock/express-typescript-starter/issues/6/comments',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-core.js/3.6.0 Node.js/16.16.0 (linux; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: '{"body":"This is a multi-line test comment\n- With GitHub Markdown ✨\n- Created by [create-or-update-comment][1]\n\n[1]: https://github.com/peter-evans/create-or-update-comment"}',
request: {
agent: Agent {
_events: [Object: null prototype] {
free: [Function (anonymous)],
newListener: [Function: maybeEnableKeylog]
},
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object: null prototype] { path: null },
requests: [Object: null prototype] {},
sockets: [Object: null prototype] {},
freeSockets: [Object: null prototype] {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 0,
maxCachedSessions: 100,
_sessionCache: {
map: {
'api.github.com:443:::::::::::::::::::::': [Buffer [Uint8Array]]
},
list: [ 'api.github.com:443:::::::::::::::::::::' ]
},
[Symbol(kCapture)]: false
},
hook: [Function: bound bound register]
}
}
}

Hi @ngimdock

There is a note in the readme about this error.

Note: In public repositories this action does not work in pull_request workflows when triggered by forks. Any attempt will be met with the error, Resource not accessible by integration. This is due to token restrictions put in place by GitHub Actions. Private repositories can be configured to enable workflows from forks to run without restriction. See here for further explanation. Alternatively, use the pull_request_target event to comment on pull requests.