deploy-gate
deploy-gate copied to clipboard
Update GitHub PR comment when request expires or gets approved
Problem
The deploy-gate action posts a PR comment with 'Review & approve โ' link when a deploy request is created. This comment never updates โ it still says 'Approval required' even after:
- The request expires (link leads to dead page)
- The request is approved (link is redundant)
- The request is denied (confusing signal)
Solution
Option A: Webhook-driven comment updates (preferred)
PP app fires a webhook to the deploy-gate action (or a separate GitHub bot) when request status changes. The bot updates the existing PR comment:
- Approved: 'โ Approved by {approver} ยท Receipt: {link}' + collapse the approval request section
- Expired: 'โ ๏ธ Approval expired after {N}h โ re-run the workflow or push a commit to request again'
- Denied: 'โ Denied by {approver}: {reason}'
Option B: Polling from the action
The deploy-gate action polls for status updates while the workflow is running. Less ideal but simpler.
Option C: Smart landing page
The review page URL handles stale links gracefully (covered by issue on app repo). This is complementary, not a replacement.
Success criteria
- GitHub PR comment reflects current request status
- No stale 'Review & approve โ' links pointing to expired/completed pages