FirebaseExtended / action-hosting-deploy

Automatically deploy shareable previews for your Firebase Hosting sites
https://firebase.google.com/docs/hosting/github-integration
Apache License 2.0
695 stars 202 forks source link

Allowing comment for actions on a private repository within an org, invoked by a PR from a fork. #281

Closed naturedamends closed 1 year ago

naturedamends commented 1 year ago

The use case you're trying to solve

I would like for the tool to comment on the PR like normal with the particular Github setup that I have.

I use a free account with a free organisation.

I'm submitting a PR from a forked repository.

Change to the action that would solve that use case

I'm looking into it at the moment. If I find something I will comment. I'm happy to write the PR. If you can provide some direction. Or interest

info

The GITHUB_TOKEN when using this setup has at most read permission, it seem that it can't comment to a PR.

This might not be possible because of the Github being restrictive on the permissions for various reasons. Seems like something I could create a custom token for, but that option isn't enabled for my account.

Surely getting permission for just comments is possible....

log

/home/runner/work/_actions/FirebaseExtended/action-hosting-deploy/v0/bin/action.min.js:3759
                const error = new RequestError(message, status, ***
                              ^

RequestError [HttpError]: Resource not accessible by integration
    at /home/runner/work/_actions/FirebaseExtended/action-hosting-deploy/v0/bin/action.min.js:3759:31
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createCheck (/home/runner/work/_actions/FirebaseExtended/action-hosting-deploy/v0/bin/action.min.js:5680:17)
    at async run (/home/runner/work/_actions/FirebaseExtended/action-hosting-deploy/v0/bin/action.min.js:11435:14) ***
  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: 'Fri, 28 Apr 2023 07:02:48 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': '8C04:8146:288EE37:29B2BAE:644B6F98',
    'x-ratelimit-limit': '1000',
    'x-ratelimit-remaining': '998',
    'x-ratelimit-reset': '1682668830',
    'x-ratelimit-resource': 'core',
    'x-ratelimit-used': '2',
    'x-xss-protection': '0'
  ***,
  request: ***
    method: 'POST',
    url: 'https://api.github.com/repos/natured-amends/blog/check-runs',
    headers: ***
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-core.js/3.2.4 Node.js/16.16.0 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    ***,
    body: '***"name":"Deploy Preview","head_sha":"8feea9083cb01febc1e5643263f6936738e91c90","status":"in_progress"***',
    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]
    ***
  ***,
  documentation_url: 'https://docs.github.com/rest/reference/checks#create-a-check-run'
***
dominoFire commented 1 year ago

Have you tried with a paying GitHub subscription? I'm interested in knowing that could solve the issue.

naturedamends commented 1 year ago

Have you tried with a paying GitHub subscription? I'm interested in knowing that could solve the issue.

No. If only the world were that simple.