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

ci: let Netlify post preview URL again #2489

Merged
merged 9 commits into from
May 6, 2024
Merged

ci: let Netlify post preview URL again #2489

merged 9 commits into from
May 6, 2024

Conversation

maelle
Copy link
Collaborator

@maelle maelle commented Apr 23, 2024

No description provided.

@maelle maelle requested a review from hadley April 23, 2024 07:08
@maelle maelle marked this pull request as draft April 23, 2024 08:07
@maelle
Copy link
Collaborator Author

maelle commented Apr 23, 2024

Now the URL is posted, yay, but I still see an error in the checks log:

RequestError [HttpError]: Resource not accessible by integration
    at /home/runner/work/_actions/nwtgck/actions-netlify/v2.0/dist/index.js:10385:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  status: 403,
  response: {
    url: 'https://api.github.com/repos/r-lib/pkgdown/deployments',
    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: 'Tue, 23 Apr 2024 07:58:25 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-accepted-github-permissions': 'deployments=write',
      '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': '3480:28A43D:BBA300:1390E52:66276A21',
      'x-ratelimit-limit': '5000',
      'x-ratelimit-remaining': '4999',
      'x-ratelimit-reset': '1713862705',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '1',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Resource not accessible by integration',
      documentation_url: 'https://docs.github.com/rest/deployments/deployments#create-a-deployment'
    }
  },
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/r-lib/pkgdown/deployments',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-core.js/3.6.0 Node.js/16.20.2 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"auto_merge":false,"ref":"7b21d68b32f1286d6f987e89d0ddc96974a2af0a","environment":"pull request","required_contexts":[]}',
    request: { agent: [Agent], hook: [Function: bound bound register] }
  }
}

@maelle
Copy link
Collaborator Author

maelle commented May 3, 2024

@hadley any idea what could be wrong here?

@hadley
Copy link
Member

hadley commented May 3, 2024

To me, it sounds like the resource is not accessible by the integration so you should make it accessible 😆

'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
# these default to 'true'
enable-commit-comment: false
enable-github-deployment: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the only change that's only significant — I don't know the netlify action started doing this by default, but we don't need it and GHA don't have permission for it by default.

@hadley
Copy link
Member

hadley commented May 4, 2024

I pulled the netlify stuff out into a separate file since I think this will make maintenance since it'll no longer get clobbered when we update the standard pkgdown workflow.

Copy link

github-actions bot commented May 4, 2024

@hadley hadley marked this pull request as ready for review May 4, 2024 01:11
@hadley
Copy link
Member

hadley commented May 4, 2024

I also switched the comment back on, since I find that easier to locate.

@maelle
Copy link
Collaborator Author

maelle commented May 6, 2024

Cool, thanks!

I made a commit mainly to check the action will update its comment as opposed to creating a new comment. 👀

@maelle
Copy link
Collaborator Author

maelle commented May 6, 2024

The docs state "Overwrites comment on pull request (default: true)" so all good 😸

@maelle
Copy link
Collaborator Author

maelle commented May 6, 2024

Fine to merge I suppose.

@hadley hadley merged commit 10b398d into main May 6, 2024
13 checks passed
@hadley hadley deleted the maelle-patch-2 branch May 6, 2024 14:19
@hadley
Copy link
Member

hadley commented May 6, 2024

I feel like I'm going to get annoyed by the comment thing again, but we'll see!

SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 2024
And keep github pages and netlify workflows separate to hopefully avoid problems in the future.
 
---------

Co-authored-by: Hadley Wickham <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants