8000 Use pull_request_target to run kitchen tests in the context of main by tpowell-progress · Pull Request #15480 · chef/chef · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@tpowell-progress
Copy link
Contributor
@tpowell-progress tpowell-progress commented Nov 26, 2025

Description

GitHub Actions improvements for fork and pull request workflows:

In order to solve this, we’ve added a new pull_request_target event, which behaves in an almost identical way to the pull_request event with the same set of filters and payload. However, instead of running against the workflow and code from the merge commit, the event runs against the workflow and code from the base of the pull request. This means the workflow is running from a trusted source and is given access to a read/write token as well as secrets enabling the maintainer to safely comment on or label a pull request. This event can be used in combination with the private repository settings as well.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

Signed-off-by: Thomas Powell <thomas.powell@progress.com>
@tpowell-progress tpowell-progress requested review from a team and jaymzh as code owners November 26, 2025 17:33
@Stromweld
Copy link
Contributor

we should also then pull out the chef-license key and add it as a secret env variable.

@johnmccrae johnmccrae closed this Nov 26, 2025
@johnmccrae johnmccrae reopened this Nov 27, 2025
@jaymzh
Copy link
Collaborator
jaymzh commented Nov 27, 2025

Can you do this as a fork, so we can see the results before we merge it, please?

@neha-p6
Copy link
Collaborator
neha-p6 commented Dec 1, 2025

@tpowell-progress None of the TKE workflows seem to have run here? The change in kitchen.yml seems have caused some issue for the runs to be skipped

@tpowell-progress
Copy link
Contributor Author

Can you do this as a fork, so we can see the results before we merge it, please?

@jaymzh pull_request_target needs to be merged into the base branch prior to actually taking effect. The "disabled" kitchen tests that @neha-p6 is seeing are a symptom of that, in which I've pulled out the pull_request hook but pull_request_target is not yet merged.

@sean-sype-simmons sean-sype-simmons added the Expeditor: Skip All Used to skip all merge_actions. label Dec 1, 2025
Copy link
Collaborator
@sean-sype-simmons sean-sype-simmons left a comment

Choose a reason for hiding this comment

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

let me do some more reading on this ~ before we merge. This should be fine, but need to understand how secrets are accessed.

@Stromweld
8000 Copy link
Contributor

@sean-sype-simmons This blog has some info and here are the docs on the setting if it helps.

Signed-off-by: Thomas Powell <thomas.powell@progress.com>
@sonarqubecloud
Copy link
sonarqubecloud bot commented Dec 2, 2025

@jaymzh
Copy link
Collaborator
jaymzh commented Dec 2, 2025

@tpowell-progress - need conflict resolution

@jaymzh
Copy link
Collaborator
jaymzh commented Dec 2, 2025

FYI - we can't merge this as-is. We need to checkout the PR commit, because pull_request_target runs on the base of the PR, not the PR commit.

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

Labels

Expeditor: Skip All Used to skip all merge_actions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

0