Skip to content

Feature/GitHub commit status#36

Merged
chris11-taylor-nttd merged 11 commits intomainfrom
feature/github-commit-status
Sep 16, 2024
Merged

Feature/GitHub commit status#36
chris11-taylor-nttd merged 11 commits intomainfrom
feature/github-commit-status

Conversation

@chris11-taylor-nttd
Copy link
Copy Markdown
Contributor

This PR adds functionality to retrieve and set GitHub commit statuses from the CLI or within a pipeline.

# launch github commit status set --help                                                                                                                                              Usage: launch github commit status set [OPTIONS]

Options:
  --organization TEXT             GitHub organization containing your
                                  repository. Defaults to the launchbynttdata
                                  organization.
  --repository-name TEXT          Name of the repository to be updated.
                                  [required]
  --commit-hash TEXT              Full SHA1 hash of a Git commit.  [required]
  --target-url TEXT               The URL to link when setting a commit status
                                  message.
  --description TEXT              A short message to associate with the commit
                                  status.
  --context TEXT                  A string label to differentiate this status
                                  from the status of other systems.
  --status [error|failure|pending|success]
                                  The status to set on the commit.  [required]
  --help                          Show this message and exit.

# launch github commit status get --help
Usage: launch github commit status get [OPTIONS]

Options:
  --organization TEXT     GitHub organization containing your repository.
                          Defaults to the launchbynttdata organization.
  --repository-name TEXT  Name of the repository to be updated.  [required]
  --commit-hash TEXT      Full SHA1 hash of a Git commit.  [required]
  --context TEXT          A string label to differentiate this status from the
                          status of other systems.
  --help                  Show this message and exit.
# Set a "pending" status on a commit to indicate a CI run is in progress. 
# The "context" and "description" are displayed on the PR page, and the 
# "target URL" is linked through the "Details" button, allowing a user
# to link directly into a CI pipeline run:
launch github commit status set \
    --repository-name "tf-aws-module_primitive-api_gateway_v2" \
    --commit-hash "a87b67e7040ec3fc48c5e3c20f6f6f42b611c1b8" \
    --status pending \
    --target-url "https://launch.nttdata.com" \
    --context "ci/shared-aws-terraform-pipeline" \
    --description "Build in progress..."
image
# Set a "complete" status on a commit to allow the merge
# to proceed.
launch github commit status set \
    --repository-name "tf-aws-module_primitive-api_gateway_v2" \
    --commit-hash "a87b67e7040ec3fc48c5e3c20f6f6f42b611c1b8" \
    --status complete \
    --target-url "https://launch.nttdata.com" \
    --context "ci/shared-aws-terraform-pipeline" \
    --description "Build succeeded."
image
# Retrieve a commit status
launch github commit status get \
    --repository-name "tf-aws-module_primitive-api_gateway_v2" \
    --commit-hash "a87b67e7040ec3fc48c5e3c20f6f6f42b611c1b8" \
    --context "ci/shared-aws-terraform-pipeline"
success

@chris11-taylor-nttd chris11-taylor-nttd requested a review from a team as a code owner September 12, 2024 19:56
@chris11-taylor-nttd chris11-taylor-nttd force-pushed the feature/github-commit-status branch from 318e721 to d66997d Compare September 12, 2024 20:07
@chris11-taylor-nttd chris11-taylor-nttd merged commit bb38213 into main Sep 16, 2024
@chris11-taylor-nttd chris11-taylor-nttd deleted the feature/github-commit-status branch September 16, 2024 15:24
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.

3 participants