Skip to content

CI Add link to changelog instructions #31954

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

StefanieSenger
Copy link
Member

@StefanieSenger StefanieSenger commented Aug 15, 2025

What does this implement/fix? Explain your changes.

This PR adds a link to the changelog instructions into the CI output summary below the PR.

If the changelog is not provided, the CI summary should now look similar to this (but with a different icon in the beginning, see #31954 (comment) for the icon):
Screenshot From 2025-08-15 20-50-12
If the changelog is either provided or not needed, the additional commit status does not show at all:
Screenshot From 2025-08-15 20-49-51

Any other comments?

Adding the link directly to the CI status titled "Check Changelog / A reviewer will let you know if it is required or can be bypassed (pull_request)" would be ideal, but I think it is not possible without re-writing both the actions used in "uses" and that's pretty complicated.

I have tried this on my fork first and you can see a CI summary for a PR without changelog here and a CI summary for a PR with added changelog here (but they both have a wrong link and a few tiny things a different, too).

We had talked about that, @lesteve. Maybe you like to have a look?

Copy link

github-actions bot commented Aug 15, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 775c06a. Link to the linter CI: here

@StefanieSenger
Copy link
Member Author

StefanieSenger commented Aug 15, 2025

I have also noted that currently, the check job (45 s) runs when any label is set or unset and also on forks.

Maybe we could only have it run if the changelog label is unset by adding a condition if: github.event.label.name == 'No Changelog Needed'?

We could also only run it on scikit-learn repo by adding a condition if: github.repository == 'scikit-learn/scikit-learn'?

script: |
github.rest.repos.createCommitStatus({
sha: context.payload.pull_request.head.sha,
state: "error",
Copy link
Member Author

@StefanieSenger StefanieSenger Aug 15, 2025

Choose a reason for hiding this comment

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

              state: "error",

This state defines the icon that is shown before the status. It can be

  • "error" to show a yellow triangle with exclamation mark
  • "failure" to show a red circle with an x, like in failed jobs (like in the first screenshot on the PR description)
  • "neutral" to show a grey empty circle

@@ -1,6 +1,7 @@
name: Check Changelog
permissions:
contents: read
statuses: write
Copy link
Member

Choose a reason for hiding this comment

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

With the pull_request trigger, I'm not sure if a PR from a fork would have enough permissions to write a status.

Copy link
Member Author

@StefanieSenger StefanieSenger Aug 16, 2025

Choose a reason for hiding this comment

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

Hey @thomasjpfan, sorry I am not sure if I understand your comment. I have tried this in my fork and verified it works before opening this PR.

Do you mean that PRs on a fork might not have permission to write statuses on the upstream repo? Is using pull_request_target instead a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants