ynput / ops-repo-automation

Collection of automation tools and github-workflows for Ayon related repositories.
0 stars 0 forks source link

Maintain project status automatically on PR reivew states #24

Open jakubjezek001 opened 4 days ago

jakubjezek001 commented 4 days ago

Is there an existing issue for this?

Please describe the enhancement you have in mind and explain what the current shortcomings are?

Every approved or change-requested PR review status should also be manually updated in the Ynteam planning projects. This might not always happen because someone might forget.

How would you imagine the implementation of the enhancement?

We could have worklflow which would do this automatically.

We might also need to add additional status into Ynteam planning for Change requested, right @dee-ynput ?

Are there any labels you wish to add?

Describe alternatives you've considered:

No response

Additional context:

No response

philnewm commented 3 days ago

Makes sense to me, I quickly checked what GitHubs API offers here.

This documentation example seems promising

on:
  pull_request_review:
    types: [submitted]

jobs:
  approved:
    if: github.event.review.state == 'approved'
    runs-on: ubuntu-latest
    steps:
      - run: echo "This PR was approved"

According to a quick ChatGPT request this should also work for change requests

- name: Check review state
  run: |
    if [[ "${{ github.event.review.state }}" == "approved" ]]; then
      echo "The pull request was approved!"
      # Add your actions here for when the PR is approved
    elif [[ "${{ github.event.review.state }}" == "changes_requested" ]]; then
      echo "Changes were requested on the pull request!"
      # Add your actions here for when changes are requested

And also in this case we need a global way to control it and or let repositories inherit this workflow from the organization level.

dee-ynput commented 7 hours ago

I have the feeling project workflow can handle that. They are limited, but meant for this I think. That would be way better since the confirmation would be attached to the project instead of spread all around in each repository.

philnewm commented 7 hours ago

@dee-ynput What exactly is the "project workflow"? And would that make the request here obsolete or not?