Skip to content

Commit

Permalink
feat: skip GH Commit Status (#312)
Browse files Browse the repository at this point in the history
Create a GH Commit Status

Used to skip "Commit Status" checks that run for entering merge queue but shouldn't run on the merge queue branch, such as "UI Tests" in `react-chat` and `design` repos
  • Loading branch information
theProf authored Nov 29, 2024
1 parent 0ba6f9c commit 93eb4ad
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/commands/github/create_commit_status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
parameters:
check-name:
type: string
description: Name of the job to skip
status:
description: Status of check
type: enum
enum: ["error", "failure", "pending", "success"]
description:
description: Text that shows in GH checks
type: string
steps:
- run:
name: "Setting << parameters.check-name >> check to << parameters.status >>"
environment:
CHECK_NAME: "<< parameters.check-name >>"
STATUS: "<< parameters.status >>"
DESCRIPTION: "<< parameters.description >>"
command: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/voiceflow/${CIRCLE_PROJECT_REPONAME}/statuses/${CIRCLE_SHA1}" \
--data-binary @- \<<EOF
{
"state": "<< parameters.status >>",
"target_url": "https://app.circleci.com/pipelines/github/voiceflow/${CIRCLE_PROJECT_REPONAME}",
"description": "<< parameters.description >>",
"context": "<< parameters.check-name >>"
}
EOF
19 changes: 19 additions & 0 deletions src/jobs/github/create_commit_status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description: Create GH "Commit Status"
docker:
- image: cimg/base:current-22.04
parameters:
check-name:
type: string
description: Name of the job to skip
status:
description: Status of check
type: enum
enum: ["error", "failure", "pending", "success"]
description:
description: Text that shows in GH checks
type: string
steps:
- create_commit_status:
check-name: << parameters.check-name >>
status: << parameters.status >>
description: << parameters.description >>

0 comments on commit 93eb4ad

Please sign in to comment.