Skip to content

582: Add PR check - Successful deployment to staging - #649

Merged
tahminator merged 2 commits into
mainfrom
582
Jan 13, 2026
Merged

582: Add PR check - Successful deployment to staging#649
tahminator merged 2 commits into
mainfrom
582

Conversation

@tahminator

@tahminator tahminator commented Jan 13, 2026

Copy link
Copy Markdown
Member

582

Description of changes

  • Add PR check - Successful deployment to staging

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

image

@github-actions

Copy link
Copy Markdown
Contributor

The command to deploy to staging for the commit dd59c74 has been triggered. View action run

@github-actions

Copy link
Copy Markdown
Contributor

Title

582: Add PR check - Successful deployment to staging


PR Type

Enhancement


Description

  • Add commit status for staging deploy

  • Fail PR check if staging not deployed

  • Post status comment with run link


Diagram Walkthrough

flowchart LR
  A["Workflow jobs results"] -- "derive success/failure" --> B["status boolean + message"]
  B -- "createCommitStatus" --> C["GitHub Commit Status\ncontext: \"Successful deployment to staging\""]
  B -- "createComment" --> D["PR comment with status and run link"]
Loading

File Walkthrough

Relevant files
Enhancement
deploy-stg.yml
Add commit status gating on staging deployment                     

.github/workflows/deploy-stg.yml

  • Track deployment success via boolean status.
  • Create commit status with success/failure state.
  • Use context Successful deployment to staging.
  • Post PR comment with status and run URL.
+16/-1   

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Commit Status Context

Validate that the chosen commit status context Successful deployment to staging matches the required protection rule name exactly; a mismatch would prevent the PR check from gating merges.

  owner: context.repo.owner,
  repo: context.repo.repo,
  sha: commitHash,
  state: status ? 'success' : 'failure',
  context: "Successful deployment to staging",
  description: status ? undefined : "Successful deployment to staging is required",
});
Status On Cancelled

The logic marks any non-success (including cancelled) as failure; confirm this aligns with acceptance criteria, as re-run/cancel scenarios will block the PR.

if (failedJobs.length > 0 && cancelledJobs.length > 0) {
   statusMessage = `**Staging deployment failed and was cancelled** for commit ${commitHash}\n\n**`;
   status = false;
} else if (failedJobs.length > 0) {
   statusMessage = `**Staging deployment failed** for commit ${commitHash}\n\n**`;
   status = false;
} else if (cancelledJobs.length > 0) {
   statusMessage = `**Staging deployment was cancelled** for commit ${commitHash}\n\n`;
   status = false;
} else {
   statusMessage = `**Staging deployment succeeded** for commit ${commitHash}`;
   status = true;
}
Missing Target URL

Consider adding target_url to the commit status pointing to the workflow run (runUrl) for easier traceability from the PR checks UI.

await github.rest.repos.createCommitStatus({
  owner: context.repo.owner,
  repo: context.repo.repo,
  sha: commitHash,
  state: status ? 'success' : 'failure',
  context: "Successful deployment to staging",
  description: status ? undefined : "Successful deployment to staging is required",
});

Comment thread .github/workflows/deploy-stg.yml
Comment thread .github/workflows/deploy-stg.yml
Comment thread .github/workflows/deploy-stg.yml
@github-actions

Copy link
Copy Markdown
Contributor
Overall Project 75.73% 🍏

There is no coverage information present for the Files changed

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

The command to deploy to staging for the commit c23d3ed has been triggered. View action run

@github-actions

Copy link
Copy Markdown
Contributor
Overall Project 75.79% 🍏

There is no coverage information present for the Files changed

@github-actions

Copy link
Copy Markdown
Contributor

Staging deployment succeeded for commit c23d3ed

View run

@tahminator
tahminator enabled auto-merge (rebase) January 13, 2026 02:31

@az2924 az2924 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good!

@tahminator
tahminator merged commit 238dca7 into main Jan 13, 2026
24 checks passed
@tahminator
tahminator deleted the 582 branch January 13, 2026 02:32
@github-actions

Copy link
Copy Markdown
Contributor
Overall Project 75.73% 🍏

There is no coverage information present for the Files changed

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