docs.konghq.com icon indicating copy to clipboard operation
docs.konghq.com copied to clipboard

Tries to fix the broken CI workflows

Open n0vad3v opened this issue 1 year ago • 3 comments

Description

Tries to fix the broken CI workflows in PR.

Testing instructions

Preview link:

Checklist

n0vad3v avatar Apr 28 '24 15:04 n0vad3v

Deploy Preview for kongdocs ready!

Name Link
Latest commit 07f02f9218f1dc66dedc4e2141d003cec15e238a
Latest deploy log https://app.netlify.com/sites/kongdocs/deploys/662f0a5deb018c00080c0daf
Deploy Preview https://deploy-preview-7319--kongdocs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
9 paths audited
Performance: 94 (🟢 up 2 from production)
Accessibility: 93 (no change from production)
Best Practices: 98 (🟢 up 8 from production)
SEO: 91 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 28 '24 15:04 netlify[bot]

Hmmm, maybe it's needed to adjust permissions at https://github.com/organizations/Kong/settings/actions to allow GITHUB_TOKEN for more privileges

Screenshot from 2024-04-28 23-27-24

Otherwise, even manually set:

    permissions:
      contents: write
      issues: write
      pull-requests: write

theses permissions at workflow will still result in

GITHUB_TOKEN Permissions
  Contents: read
  Issues: read
  Metadata: read
  PullRequests: read

in actual run.

Screenshot from 2024-04-28 23-26-03

n0vad3v avatar Apr 28 '24 15:04 n0vad3v

The issue here is that the action triggers on pull_request rather than pull_request_target, which doesn't have access to secrets when the contributor is submitting from a fork.

Switching to pull_request_target is ok in this instance as executing the check from main is preferred 99% of the time

mheap avatar May 02 '24 12:05 mheap

@mheap Got it, 😃, so maybe it's save to close this PR now.

n0vad3v avatar May 16 '24 07:05 n0vad3v