GitHub status

Kenny DuMez
Kenny DuMez
Graphite software engineer

In-depth guide to GitHub status

GitHub provides several tools and features to help users track the status of repositories, workflows, and operations. Understanding these tools is crucial for developers, particularly when using GitHub Actions and integrating status checks in their development workflows. This guide will explore GitHub Actions status, GitHub status checks, and how to effectively use them in your projects.

GitHub Actions is an automation tool that allows you to create workflows directly within your GitHub repositories. These workflows can handle common build, test, and deployment tasks. The status of GitHub Actions is a crucial aspect as it provides real-time feedback on the success or failure of these automated steps.

When you commit to a repository that has GitHub Actions enabled, it triggers workflows defined in .yml files located in the .github/workflows directory of your repository. These workflows can be configured to run on specific branches, tags, or even when certain events occur within the repository, such as opening a pull request.

Each step of a workflow runs in a fresh, virtual environment, allowing it to execute tasks such as installing dependencies, running scripts, and deploying software. After each step, GitHub Actions updates the status, which can be one of the following:

  • Success: All steps in the workflow completed without errors.
  • Failure: One or more steps in the workflow failed.
  • Cancelled: The workflow was manually cancelled.
  • In progress: The workflow is currently running.

You can view the status of GitHub Actions directly on the GitHub repository under the "Actions" tab. Each workflow run is listed here, along with its status, the branch it was run on, and the commit that triggered it.

To check the status of GitHub Actions from your terminal, you can use the GitHub CLI tool gh. Here's how you might check the status of the latest workflow runs in your repository:

Terminal
gh run list --repo username/repo

This command will list recent runs along with their status, workflow name, and other relevant information.

A GitHub status check is a specific type of status that applies to individual commits or branches and is often used in the context of pull requests. Status checks help ensure that all necessary conditions are met before code changes are merged into the main branch.

GitHub status checks can come from services integrated into GitHub (like GitHub Actions, CI/CD services like Jenkins or CircleCI, or code quality tools like CodeClimate) or from any external service that uses the GitHub Checks API to report statuses back to GitHub.

When a pull request is opened, GitHub runs these checks to determine if the changes can be safely merged. Each check will report a status:

  • Success: The check passed, and the code meets all conditions defined by the check.
  • Failure: The check failed, indicating a problem that needs to be addressed before merging.
  • Pending: The check is still running.

These statuses are visible on the pull request page, providing a clear indicator of whether a pull request is ready to merge.

Here’s how you might set up a simple status check using GitHub Actions to run automated tests:

  1. Create a workflow file: In your repository, create a file named ci.yml in the .github/workflows directory.
Terminal
name: Continuous Integration
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
  1. Push the workflow file: Commit and push this file to your GitHub repository.
Terminal
git add .github/workflows/ci.yml
git commit -m "Add CI workflow"
git push origin main
  1. View the status: Once pushed, this workflow will trigger on every push and pull request, appearing as a status check on pull requests to the main branch.

For further reading, see the official GitHub documentation.

Stay unblocked. Ship faster.
Experience the new developer workflow - create, review, and merge code continuously. Get started with one command.
Get started

Give your PR workflow
an upgrade today

Stack easier | Ship smaller | Review quicker

Or install our CLI.
Product Screenshot 1
Product Screenshot 2