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

feat(pr-check): Create pr-check workflow #172

Merged
merged 25 commits into from
Mar 6, 2025
Merged

Conversation

chris3ware
Copy link
Member

@chris3ware chris3ware commented Mar 6, 2025

The pull request adds functionality to re-request checks in the pr-title workflow. Checks are re-requested if a comment, advising why the title is invalid, is deleted. This means the PR title is valid and that checks should be requested to update the status of failed pr-title checks on the head.sha - allowing all checks to pass.

rerunning checks is not working - going with empty commit.

The scope of this PR has changed somewhat. The logic for pushing empty commits or re-requesting checks does not work without access to the required context via pull_request_target. See this comment: #168 (comment)

This PR creates a pr-check workflow, which calls pr-title and wait-for-checks, as other repositories do to simplify the terraform for the required check on the repository ruleset.

Resolves #171

This should update the checks api status to 'success' on the head.sha
allowing the 'checks' job to pass.
PR check combines PR title and Checks into a single workflow with
dependent jobs. This achieves 2 things:
1. Checks will not run until the PR title is valid.
2. Consistent name in iac for the repository rule required check.
Required to re-request checks.
@chris3ware chris3ware requested a review from a team as a code owner March 6, 2025 07:26
@chris3ware chris3ware changed the title A bad title feat(pr-title); Mar 6, 2025
@chris3ware chris3ware changed the title feat(pr-title); feat(pr-title): Add step re-request checks Mar 6, 2025
@chris3ware chris3ware changed the title feat(pr-title): Add step re-request checks a bad title Mar 6, 2025
@chris3ware chris3ware changed the title a bad title feat(pr-title): Add step to re-request checks on edit Mar 6, 2025
@chris3ware
Copy link
Member Author

@chris3ware
Copy link
Member Author

I don't think we can get this to work this way. Better to push an empty commit now the logic is sound (the logic being: "run when comment is deleted")

Replace the `gh api` run command for re-requesting checks via the checks
api with an action to push an empty commit.
@chris3ware chris3ware changed the title feat(pr-title): Add step to re-request checks on edit another bad title Mar 6, 2025
@chris3ware chris3ware changed the title another bad title feat(pr-title): Add a step to push empty commit for check refresh Mar 6, 2025
@chris3ware chris3ware changed the title feat(pr-title): Add a step to push empty commit for check refresh a bad title Mar 6, 2025
@chris3ware chris3ware changed the title a bad title feat(pr-title): A empty commit step to trigger new checks Mar 6, 2025
@chris3ware chris3ware changed the title feat(pr-title): A empty commit step to trigger new checks feat(pr-title): Add empty commit step to trigger new checks Mar 6, 2025
@chris3ware chris3ware force-pushed the feat-pr-title-recheck branch from 983dfb7 to 20b64ce Compare March 6, 2025 12:44
@chris3ware chris3ware force-pushed the feat-pr-title-recheck branch from df31d1b to a9e48cc Compare March 6, 2025 13:06
@chris3ware
Copy link
Member Author

chris3ware commented Mar 6, 2025

Empty commit has challenges too. github token loop prevention, PAT doesn't seem to work with the commit action and the logic still isn't right. Delete comments always runs, which mean the commit action will run when we don't want it to.

@chris3ware chris3ware changed the title feat(pr-title): Add empty commit step to trigger new checks longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong Mar 6, 2025
@chris3ware chris3ware changed the title longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong feat(pr-check): Create pr-check workflow Mar 6, 2025
Now that PR check calls this workflow the pattern to be ignored is:

`Checks / auto-approve-pr`
@chris3ware chris3ware merged commit 9c6cac7 into main Mar 6, 2025
6 checks passed
@chris3ware chris3ware deleted the feat-pr-title-recheck branch March 6, 2025 16:13
3ware-release bot pushed a commit that referenced this pull request Mar 6, 2025
## [4.13.0](v4.12.0...v4.13.0) (2025-03-06)

### Features

* **pr-check:** Create pr-check workflow ([#172](#172)) ([9c6cac7](9c6cac7))
@3ware-release
Copy link
Contributor

3ware-release bot commented Mar 6, 2025

This PR is included in version 4.13.0

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

Successfully merging this pull request may close these issues.

Create pr-check workflow
2 participants