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

chore(prlint): trigger pr linter from pr reviews #26535

Merged
merged 6 commits into from
Jul 27, 2023
Merged

chore(prlint): trigger pr linter from pr reviews #26535

merged 6 commits into from
Jul 27, 2023

Conversation

kaizencc
Copy link
Contributor

This ends up being a lot of work. Essentially, the pull_request_review trigger runs the action on the merge branch which does not have the necessary secrets. This workflow has been inspired from github docs on what to do in this situation.

The PR linter takes the commit sha and pr number from the pull_request_target workflow and assumes that those values are available. So we will take those values from pull_request_review, upload them as artifacts and then download them when the pr linter action is triggered by the workflow run.

The code in index.ts hasn't been tested, but should work.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label Jul 27, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team July 27, 2023 15:38
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jul 27, 2023
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 27, 2023
Co-authored-by: Momo Kornher <mail@moritzkornher.de>
@@ -25,8 +68,8 @@ jobs:
statuses: read
issues: read
runs-on: ubuntu-latest
needs: download-if-workflow-run
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this mean download-if-workflow-run always has to run and complete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes but as far as i can tell, in order to get an output from a previous step you must depend on that step

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so right now if its not a workflow run i skip all individual steps of download-if-workflow-run (but do not skip the job)

Copy link
Contributor

@mrgrain mrgrain left a comment

Choose a reason for hiding this comment

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

@kaizencc Can you add the README entry?

Co-authored-by: Momo Kornher <mail@moritzkornher.de>
@mrgrain mrgrain added the pr/do-not-merge This PR should not be merged at this time. label Jul 27, 2023
@kaizencc kaizencc removed the pr/do-not-merge This PR should not be merged at this time. label Jul 27, 2023
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 6d3b484
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jul 27, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit f9eddc9 into aws:main Jul 27, 2023
@kaizencc kaizencc deleted the conroy/new branch July 28, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants