Yash Verma / Cloud runbook

CI/CD commands

17 commands from the cloud runbook. Fill in a placeholder once and every command uses it.

List recent GitHub Actions runs

Lists the most recent GitHub Actions workflow runs (requires gh cli).

gh run list --limit 5

github, actions, cli

Watch a GitHub Actions run

Follows the logs of a running GitHub Actions workflow.

gh run watch

github, actions, logs

Run GitHub Actions locally

Uses nektos/act to run your github actions locally via docker.

act -l

github-actions, act, local

Create PR via CLI

Creates a pull request from the current branch using GitHub CLI.

gh pr create --title "feat: my feature" --body "Description" --base main

github, pr, cli

Merge PR via CLI

Merges a pull request using squash merge.

gh pr merge --squash --delete-branch

github, pr, merge

Create GitHub release

Creates a new release on GitHub with auto-generated notes.

gh release create v1.0.0 --generate-notes

github, release, tag

Trigger Jenkins build via API

Triggers a Jenkins job build remotely using curl.

curl -X POST "https://jenkins.example.com/job/<job-name>/build" --user "<user>:$JENKINS_TOKEN"

Reads the API token from an environment variable so it stays out of your shell history.

jenkins, trigger, api

Scan image with Docker Scout

Scans a container image for known CVEs.

docker scout cves <image-name>:<tag>

security, cve, scan

Scan image with Trivy

Scans a container image for vulnerabilities using Trivy.

trivy image <image-name>:<tag>

trivy, security, vulnerability

Lint a Dockerfile

Lints a Dockerfile for best practices and common mistakes.

hadolint Dockerfile

dockerfile, lint, best-practices

ArgoCD sync app

Forces a sync of an ArgoCD application.

argocd app sync <app-name>

argocd, gitops, sync

ArgoCD diff

Shows the diff between the live state and desired state in ArgoCD.

argocd app diff <app-name>

argocd, gitops, diff

Manually trigger workflow

Triggers a workflow_dispatch event on a GitHub Actions workflow.

gh workflow run <workflow-name>

github-actions, dispatch, trigger

Semantic version bump

Bumps the version in package.json using npm.

npm version patch -m 'chore: bump version to %s'

semver, version, release

Re-run the failed jobs of a run

Re-runs only the jobs that failed in a GitHub Actions run.

gh run rerun <run-id> --failed

github, actions, retry

Show the logs of failed steps

Prints the logs of only the failed steps of a GitHub Actions run.

gh run view <run-id> --log-failed

github, actions, logs

Lint GitHub Actions workflows

Checks the workflow files in .github/workflows for syntax and expression errors.

actionlint

github, actions, lint