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

Fix: allow mkdocs preview job to write comments on PRs #2091

Merged
merged 1 commit into from
May 14, 2024

Conversation

thekaveman
Copy link
Member

This permission is needed to allow the step that adds a comment with the preview URL

@thekaveman thekaveman requested a review from a team as a code owner May 14, 2024 14:13
Copy link

Coverage report

This PR does not seem to contain any modification to coverable code.

@thekaveman thekaveman self-assigned this May 14, 2024
@github-actions github-actions bot added documentation [auto] Improvements or additions to documentation actions Related to GitHub Actions workflows and removed documentation [auto] Improvements or additions to documentation labels May 14, 2024
@thekaveman thekaveman added bug Something isn't working documentation [auto] Improvements or additions to documentation labels May 14, 2024
Copy link

Preview url: https://benefits-2091--cal-itp-previews.netlify.app

@thekaveman
Copy link
Member Author

Preview url: https://benefits-2091--cal-itp-previews.netlify.app

It works!

Copy link
Member

@angela-tran angela-tran left a comment

Choose a reason for hiding this comment

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

Just to make sure I understand, it was broken specifically for dependabot PRs right?

@thekaveman
Copy link
Member Author

thekaveman commented May 14, 2024

Just to make sure I understand, it was broken specifically for dependabot PRs right?

Yes this fix is related to Dependabot PRs.

There was a separate issue with Dependabot PRs not having access to the secrets (because there is a separate set of secrets specifically for Dependabot): #2087 (review)

Once I fixed that, this issue came up where the workflow couldn't add the preview URL comment, and it was because of this missing permission: https://github.com/cal-itp/benefits/actions/runs/9070328822/job/24952931531#step:8:31

I think the GITHUB_TOKEN for Dependabot PRs is more limited by default: dependabot/dependabot-core#3253 (comment).

For example we had a docs update back in April and the preview URL comment was added successfully: #2020 (comment)

@thekaveman thekaveman merged commit 28d2590 into dev May 14, 2024
13 checks passed
@thekaveman thekaveman deleted the fix/ci-mkdocs-preview branch May 14, 2024 15:35
@angela-tran
Copy link
Member

I think the GITHUB_TOKEN for Dependabot PRs is more limited by default: dependabot/dependabot-core#3253 (comment).

For example we had a docs update back in April and the preview URL comment was added successfully: #2020 (comment)

Makes sense! I thought I had seen it work before, so this would explain the difference. Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions Related to GitHub Actions workflows bug Something isn't working documentation [auto] Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants