Skip to content

Conversation

@polasudo
Copy link
Owner

Description

Please explain the changes you made here.

Which issue(s) does this PR fix

  • Fixes #?

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

The gh CLI commands were failing because the repository wasn't checked out.
Added actions/checkout@v4 step to ensure git context is available.
Using pull_request_target instead of pull_request allows the workflow
to run with write permissions even for PRs from forks or bot accounts.
This is necessary for adding labels and approving PRs.
…ssion

- Change trigger from pull_request to pull_request_target for proper permissions
- Add issues:write permission required for label management
- Add --repo flag to gh commands for explicit repository context
- Remove checkout step (not needed with pull_request_target)
- Fixes GraphQL: Resource not accessible by integration error
- Add push trigger on fix/auto-approve-bot branch for immediate testing
- Handle both push and pull_request_target events in workflow logic
- Add logging step for push events to show eligibility check results
- Only run label/approve actions on actual PR events
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Fix/auto approve bot". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat
 - fix
 - chore
 - docs
 - style
 - refactor
 - perf
 - test
 - revert

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Auto-Approved

This PR has been automatically approved (rhdh-bot branch).

Labels Added: lgtm, approved

- Remove all testing code (push triggers, test PR numbers, debug logging)
- Simplify workflow to only run on pull_request_target events
- Only run for rhdh-bot PRs
- Keep fix/auto-approve-bot pattern for final testing before merge
- Ready for production deployment
@polasudo polasudo closed this Nov 13, 2025
@polasudo polasudo reopened this Nov 13, 2025
polasudo and others added 4 commits November 13, 2025 18:29
- Remove temporary polasudo testing allowance
- Remove fix/auto-approve-bot test pattern
- Clean, production-ready workflow for rhdh-bot PRs
- Ready to merge and deploy
…(RHIDP-8936) (redhat-developer#3677)

Signed-off-by: Nick Boldt <nboldt@redhat.com>
@polasudo polasudo removed the lgtm label Nov 14, 2025
@polasudo polasudo closed this Nov 14, 2025
polasudo added a commit that referenced this pull request Nov 21, 2025
* fix(auto-approve): add checkout step to fix 'not a git repository' error

The gh CLI commands were failing because the repository wasn't checked out.
Added actions/checkout@v4 step to ensure git context is available.

* test: temporarily enable workflow for polasudo to test functionality

* test: add fix/auto-approve-bot to eligible patterns for testing

* fix(auto-approve): add issues:write permission for label management

* fix(auto-approve): use pull_request_target for proper permissions

Using pull_request_target instead of pull_request allows the workflow
to run with write permissions even for PRs from forks or bot accounts.
This is necessary for adding labels and approving PRs.

* Fix auto-approve workflow: use REST API for adding labels instead of gh CLI

* test: trigger workflow re-run

* test: remove trigger file

* test: temporarily disable user condition to test workflow

* fix(auto-approve): use pull_request_target and add issues:write permission

- Change trigger from pull_request to pull_request_target for proper permissions
- Add issues:write permission required for label management
- Add --repo flag to gh commands for explicit repository context
- Remove checkout step (not needed with pull_request_target)
- Fixes GraphQL: Resource not accessible by integration error

* fix(auto-approve): add fix/auto-approve-bot pattern for testing

* feat(auto-approve): add push trigger for faster testing feedback

- Add push trigger on fix/auto-approve-bot branch for immediate testing
- Handle both push and pull_request_target events in workflow logic
- Add logging step for push events to show eligibility check results
- Only run label/approve actions on actual PR events

* test: trigger workflow rerun

* test: simplify push logging to debug workflow triggering

* test: add temporary PR labeling simulation for fork testing

* test: enable real PR labeling on push events for testing

* test: target PR #1 in fork for labeling test

* test: target PR #2 for labeling demonstration

* feat: clean up auto-approve workflow for production use

- Remove all testing code (push triggers, test PR numbers, debug logging)
- Simplify workflow to only run on pull_request_target events
- Only run for rhdh-bot PRs
- Keep fix/auto-approve-bot pattern for final testing before merge
- Ready for production deployment

* test: temporarily allow polasudo for final workflow testing

* feat: finalize auto-approve workflow for production

- Remove temporary polasudo testing allowance
- Remove fix/auto-approve-bot test pattern
- Clean, production-ready workflow for rhdh-bot PRs
- Ready to merge and deploy

* test: trigger workflow to demonstrate PR #2 labeling

* Delete test-workflow-final.md

* chore: reorganize auto-approve workflow flags for better readability
polasudo added a commit that referenced this pull request Nov 27, 2025
…eveloper#3717)

* fix(auto-approve): add checkout step to fix 'not a git repository' error

The gh CLI commands were failing because the repository wasn't checked out.
Added actions/checkout@v4 step to ensure git context is available.

* test: temporarily enable workflow for polasudo to test functionality

* test: add fix/auto-approve-bot to eligible patterns for testing

* fix(auto-approve): add issues:write permission for label management

* fix(auto-approve): use pull_request_target for proper permissions

Using pull_request_target instead of pull_request allows the workflow
to run with write permissions even for PRs from forks or bot accounts.
This is necessary for adding labels and approving PRs.

* Fix auto-approve workflow: use REST API for adding labels instead of gh CLI

* test: trigger workflow re-run

* test: remove trigger file

* test: temporarily disable user condition to test workflow

* fix(auto-approve): use pull_request_target and add issues:write permission

- Change trigger from pull_request to pull_request_target for proper permissions
- Add issues:write permission required for label management
- Add --repo flag to gh commands for explicit repository context
- Remove checkout step (not needed with pull_request_target)
- Fixes GraphQL: Resource not accessible by integration error

* fix(auto-approve): add fix/auto-approve-bot pattern for testing

* feat(auto-approve): add push trigger for faster testing feedback

- Add push trigger on fix/auto-approve-bot branch for immediate testing
- Handle both push and pull_request_target events in workflow logic
- Add logging step for push events to show eligibility check results
- Only run label/approve actions on actual PR events

* test: trigger workflow rerun

* test: simplify push logging to debug workflow triggering

* test: add temporary PR labeling simulation for fork testing

* test: enable real PR labeling on push events for testing

* test: target PR #1 in fork for labeling test

* test: target PR #2 for labeling demonstration

* feat: clean up auto-approve workflow for production use

- Remove all testing code (push triggers, test PR numbers, debug logging)
- Simplify workflow to only run on pull_request_target events
- Only run for rhdh-bot PRs
- Keep fix/auto-approve-bot pattern for final testing before merge
- Ready for production deployment

* test: temporarily allow polasudo for final workflow testing

* feat: finalize auto-approve workflow for production

- Remove temporary polasudo testing allowance
- Remove fix/auto-approve-bot test pattern
- Clean, production-ready workflow for rhdh-bot PRs
- Ready to merge and deploy

* test: trigger workflow to demonstrate PR #2 labeling

* Delete test-workflow-final.md

* chore: reorganize auto-approve workflow flags for better readability

* fix(ci): add checkout step to auto-approve-bot-prs workflow to fix git repository error

- Adds actions/checkout@v4 to provide git context for gh CLI commands
- Fixes 'fatal: not a git repository' error in auto-approve workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants