Custom deployment protection rules: callback scope for sequential jobs and run attempts #207100
Replies: 1 comment
|
From the current API, I don't think you can safely treat the approval callback as being scoped to a specific job or run attempt. The approval endpoint only takes the For your case, I would handle each For reruns, I would avoid approving based only on So for the four points:
If you require a guaranteed separate authorization for every individual job/attempt, I wouldn't rely on If this resolves your question, please mark it as the answer. 🙂 |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
💬 Feature/Topic Area
Webhooks
Body
I’m trying to understand the supported behavior of GitHub App custom deployment protection rules when two sequential jobs use the same protected environment and App rule.
This concerns custom App callbacks, not required-reviewer approvals. It is a documentation/behavior clarification, not a report of a confirmed approval bypass.
The simplified workflow is:
Both jobs reference the same environment;
job_bdepends on successful completion ofjob_a. We need a separate authorization decision for each job.The documented callback identifies the workflow run and environment:
{ "environment_name": "protected-environment", "state": "approved", "comment": "Decision for the current request" }I have four related questions:
Request-to-job correlation
Before approving a
deployment_protection_rulewebhook request, how can the App identify the exact pending job and run attempt that generated it? Is correlation through the webhook’s deployment ID and the Checks/Actions APIs supported and available before approval? Which fields and permissions are required?Sequential jobs sharing an environment
Does GitHub require a separate custom-rule decision for each sequential job? What determines which pending request the callback affects, given that it specifies the run and environment rather than a job ID or attempt?
Delayed callbacks and webhook redelivery
If
job_ahas been approved andjob_bis now waiting, what happens to a delayed or duplicate approval callback originally prepared forjob_a? Would GitHub reject it, and what determines its scope?Workflow reruns
Since a rerun retains the run ID while incrementing the attempt, what happens to a callback associated with an earlier attempt? How should the App associate the incoming webhook with its originating attempt rather than merely reading the latest attempt?
I have consulted the custom protection-rule documentation and the callback REST reference, but haven’t found an explicit answer covering this scenario.
Any documentation pointers or first-hand experience would be appreciated, particularly clarification of what is supported behavior versus an observation from a particular workflow.
All reactions