Accessing the "requestor" for a Github Copilot PR #175691
Replies: 3 comments
-
Hi @heyitsaamir Possible Approaches:
Example Workflow Snippet (Require Manual Comment): name: Require Manual Test Confirmation
on:
issue_comment:
types: [created]
jobs:
require-human-confirmation:
if: github.event.issue.pull_request && github.event.issue.user.login == 'github-copilot[bot]'
runs-on: ubuntu-latest
steps:
- name: Check comment author
if: startsWith(github.event.comment.user.login, 'github-copilot') == false
run: |
if [[ "${{ github.event.comment.body }}" == *"/tested"* ]]; then
echo "Manual confirmation received!"
else
echo "Waiting for manual confirmation."
exit 1
fi |
Beta Was this translation helpful? Give feedback.
-
You can do this in your GitHub Actions workflow using the github context. Every PR event has an actor field that tells you who opened the PR. You can access it like this in your workflow: on: jobs: github.actor gives the user who created/triggered the PR. You can then add a step that requires a comment from the requestor before merging. Combine this with branch protection rules or a “manual approval” step to enforce it. This way, you can automatically flag PRs created by Copilot and request explicit human verification. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Question
What GitHub Actions topic or product is this about?
Workflow Configuration
Discussion Details
I would like to create an action where if a PR is by github copilot, I want an explicit comment by the requestor of that PR that they have manually tested it. How do I access who that might be?
Beta Was this translation helpful? Give feedback.
All reactions