SUMMARY
Given the recommended workflow (in "README.md" or in ".github/workflows/cpr.yml"), Conventional-pr does not re-validate pull requests after each push to the pull request. This can allow unconventional commits to be pushed to the pull request while the until the pull request's status is updated to trigger cpr's workflow and run it against the latest commit of the pull request.
This may require support on GitHub's end to allow workflows to be triggered by "pushes to pull requests" unless there is an existing Action that exposes equivalent functionality or the logic needed to determine if the current commit was pushed to a pull request branch.
DESCRIPTION
Given the following workflow file...
name: Conventional Pull Request
# See https://github.com/Namchee/conventional-pr
on:
pull_request:
types: [opened, reopened, ready_for_review]
jobs:
cpr:
runs-on: ubuntu-latest
steps:
- name: conventional-pr
uses: Namchee/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
...subsequent pushes to a pull request will only be checked when the status of the pull requests is changed to Opened, Reopened, or Ready.
Otherwise, new and possibly unconventional commits will not be validated.
The following is the result of checks triggered by a subsequent push to a pull request. Notice the lack of Conventional Pull Request.
This next image shows that Conventional Pull Requests will re-check a pull request if the status of the pull request is changed to Ready.
SOLUTION(S)
It would be more convenient if the Action could run after every push to the pull request.
1
GitHub probably does not expose a bool or Event for this purpose i.e. "pull_request_push".
So, a third party Action would need to be depended upon–or in-house logic would need to be implemented–to determine if the current workflow run was triggered by a Push event.
If true, then check if the target branch of that push is a pull request branch.
Unfortunately, this proposed implementation would require a workflow run to check for very Push event. This is undesirable, but there might not be an alternative.
2
If GitHub does have an event specifically for subsequent pull request pushes, then this issue will be much easier to resolve.