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

PR title empty commit step #168

Open
chris3ware opened this issue Mar 5, 2025 · 5 comments
Open

PR title empty commit step #168

chris3ware opened this issue Mar 5, 2025 · 5 comments

Comments

@chris3ware
Copy link
Member

I would like to push an empty commit when pr title validation failures are corrected because this will trigger enforce-all-checks to run on a new head.sha as discussed here: poseidon/wait-for-status-checks#383 (comment). The edited type does not produce a new commit.

The step to push the empty commit is not running because access to the required contexts is not available with the pull_request event; pull_request_target should be used. (According to copilot). I have verified that the context output is empty with the following:

- name: dump pull request event details
  run: |
    echo "PR action: ${{ github.event.pull_request.action }}"
    echo "PR changes: ${{ toJSON(github.event.pull_request.changes) }}"

# Trigger checks with empty commit when PR title is edited to resolve validation failure
  - name: Trigger checks with empty commit
  if: ${{ github.event.pull_request.action == 'edited' && github.event.pull_request.changes.title.from != null }}
    run: |
      echo "Title changed from: ${{ github.event.pull_request.changes.title.from }}"

Produces:

Run echo "PR action: "
  echo "PR action: "
  echo "PR changes: null"

I either need to change it to run on pull_request_target or think of another way to trigger

Originally posted by @chris3ware in #167 (comment)

@james3ware
Copy link
Member

I think the new pr-check workflow, where 'checks' job needs 'pr-title' job in the same workflow will resolve this because 'checks' will not run until 'pr-title' succeeds.

@chris3ware
Copy link
Member Author

Tested here: https://github.com/3ware/repoman/pull/214

pr-check workflow has the same issue.

@chris3ware
Copy link
Member Author

Maybe we can try updating the status of the check run to "successful"

https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#update-a-check-run

@chris3ware
Copy link
Member Author

chris3ware commented Mar 6, 2025

Maybe we can try updating the status of the check run to "successful"

https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#update-a-check-run

#172 (comment)

@chris3ware
Copy link
Member Author

I would like to push an empty commit when pr title validation failures are corrected because this will trigger enforce-all-checks to run on a new head.sha as discussed here: poseidon/wait-for-status-checks#383 (comment). The edited type does not produce a new commit.

The step to push the empty commit is not running because access to the required contexts is not available with the pull_request event; pull_request_target should be used. (According to copilot). I have verified that the context output is empty with the following:

- name: dump pull request event details
  run: |
    echo "PR action: ${{ github.event.pull_request.action }}"
    echo "PR changes: ${{ toJSON(github.event.pull_request.changes) }}"

# Trigger checks with empty commit when PR title is edited to resolve validation failure
  - name: Trigger checks with empty commit
  if: ${{ github.event.pull_request.action == 'edited' && github.event.pull_request.changes.title.from != null }}
    run: |
      echo "Title changed from: ${{ github.event.pull_request.changes.title.from }}"

Produces:

Run echo "PR action: "
  echo "PR action: "
  echo "PR changes: null"

I either need to change it to run on pull_request_target or think of another way to trigger

Originally posted by @chris3ware in #167 (comment)

I think this is only solution to this, because we can conditionally run a step when the title is edited. Anything else is too complicated.

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

No branches or pull requests

2 participants