Skip to content
CI/CD Snippets
Search
K
Main Navigation
Home
Catalog Explorer
Snippets
Encyclopedia
Guides
Capstone
Appearance
Menu
Return to top
Catalog Explorer
Filter all
790
encyclopedia entries by kind, platform, tool, difficulty, or keyword.
All
790
snippet
500
template
60
failure
100
configuration
100
pattern
30
All platforms
cloud-cli
cross-platform
gitea-actions
github-actions
github-cli
gitlab-ci
kubernetes
local-lab
local-linux
All levels
advanced
foundation
intermediate
All categories
ai-and-inference
ansible
api-network
app
artifact-cache
artifacts
binary
ci-diagnostics
cloud
compliance
compose
data-flow
database
delivery
dependencies
distributed
docker
docker-build
docker-runtime
dockerfiles
execution-and-optimization
finops
gitea-foundation
gitops
governance
gpu
helm
infrastructure-and-platform
isolation
jobs
kube-foundation
kubernetes
language-builds
llm
matrix
monitoring
monorepo
networking
orchestration
permissions
platform
policy
previews
python
registries
release-and-deployment
reliability-and-security
reuse-cache
runner
secure-basics
shell
sre
templates-foundation
templates-inference
templates-infrastructure
templates-reliability
terraform
testing
triggers
variables
yaml
Reset
Showing
60
of
790
matching entries
CICD-001
snippet
Run on every push
Push a commit and confirm one Actions run is created.
github-actions
gitea-actions
triggers
foundation
CICD-002
snippet
Limit pushes to main
Push to main and a feature branch. Only the former should trigger.
github-actions
gitea-actions
triggers
foundation
CICD-003
snippet
Verify pull requests targeting main
The branch filter matches the target branch. Open a PR and check its run.
github-actions
gitea-actions
triggers
foundation
CICD-004
snippet
Select pull request activity types
Push another commit to the PR and inspect the synchronize event.
github-actions
gitea-actions
triggers
foundation
CICD-005
snippet
Launch a manual run
Put the workflow on the default branch. Use Actions to start it on a selected ref.
github-actions
gitea-actions
triggers
foundation
CICD-006
snippet
Select a manual target
Read inputs.target in a job and test both values. Check Gitea support for typed choices.
github-actions
gitea-actions
triggers
foundation
CICD-007
snippet
Schedule a weekly check
Interpret UTC and expect best-effort timing on the default branch.
github-actions
gitea-actions
triggers
foundation
CICD-008
snippet
Trigger on version tags
Use a protected tag namespace and validate its SemVer separately.
github-actions
gitea-actions
triggers
foundation
CICD-009
snippet
Filter service paths
Push a change in each watched input. Keep required gate checks discoverable.
github-actions
gitea-actions
triggers
foundation
CICD-010
snippet
Handle published releases
Observe github.event.release.tag_name from a published test release.
github-actions
gitea-actions
triggers
foundation
CICD-011
snippet
React to a completed workflow
GitHub runs this on failure too. Filter by conclusion at job scope before privileged operations.
github-actions
gitea-actions
triggers
foundation
CICD-012
snippet
Name runs by actor and ref
Read the changed title in Actions. Confirm run-name support on the Gitea version in use.
github-actions
gitea-actions
triggers
foundation
CICD-013
snippet
Select an Ubuntu runner
Confirm the queue finds the configured label. A Gitea label maps to its configured executor.
github-actions
gitea-actions
jobs
foundation
CICD-014
snippet
Probe execution context
Compare runner host and container output to identify the execution environment.
local-linux
github-actions
gitea-actions
jobs
foundation
CICD-015
snippet
Check out the triggering commit
Check for .git and verify git rev-parse HEAD. PR runs may check out a merge ref.
github-actions
gitea-actions
jobs
foundation
CICD-016
snippet
Check out full history
Use merge-base on fetched refs rather than assuming an ancestor exists in a shallow clone.
github-actions
gitea-actions
jobs
foundation
CICD-017
snippet
Define a job dependency
Add to the build job. It starts after both upstream jobs succeed.
github-actions
gitea-actions
jobs
foundation
CICD-018
snippet
Run sibling jobs in parallel
Place under jobs and inspect independent queueing. Shared runner capacity may serialize them.
github-actions
gitea-actions
jobs
foundation
CICD-019
snippet
Run work inside a job container
A container-capable Linux runner is required. Verify the image actually provides the executable.
github-actions
gitea-actions
jobs
foundation
CICD-020
snippet
Set a job timeout
Bound a job that can hang. Use a short disposable proof job to observe late-step cancellation.
github-actions
gitea-actions
jobs
foundation
CICD-021
snippet
Make an experimental job non-blocking
Apply only to an experimental job. Confirm branch protection requires stable checks separately.
github-actions
gitea-actions
jobs
foundation
CICD-022
snippet
Use a protected deployment environment
Configure actual environment protection in the platform and verify when the job pauses.
github-actions
jobs
foundation
CICD-023
snippet
Set shell defaults for run steps
Provision the directory with checkout first. Action steps retain their own working directory.
github-actions
gitea-actions
bash
jobs
foundation
CICD-024
snippet
Prioritize new checks on a branch
Verify a new push cancels a running obsolete PR check. Scope group names to avoid collisions.
github-actions
gitea-actions
jobs
foundation
CICD-025
snippet
Pass a file path through a step variable
Set the file from the producer and prove the consumer fails if it is absent.
github-actions
gitea-actions
data-flow
foundation
CICD-026
snippet
Use a repository configuration variable
Configure a non-secret repository variable with exact spelling. Empty configuration should fail visibly.
github-actions
gitea-actions
data-flow
foundation
CICD-027
snippet
Write a variable for later steps
Observe BUILD_MODE in a later step in the same job.
local-linux
github-actions
gitea-actions
data-flow
foundation
CICD-028
snippet
Add a private tool directory to PATH
Put a checked executable in this directory and use it only in later steps.
local-linux
github-actions
gitea-actions
data-flow
foundation
CICD-029
snippet
Emit a producer step output
Set an ID on the producer and read steps.ID.outputs.image_tag.
local-linux
github-actions
gitea-actions
data-flow
foundation
CICD-030
snippet
Pass an output across jobs
Declare digest in the producer's job outputs and distinguish it from a missing artifact.
github-actions
gitea-actions
data-flow
foundation
CICD-031
snippet
Write a readable run summary
The job summary should show the commit without downloading a log file.
local-linux
github-actions
gitea-actions
data-flow
foundation
CICD-032
snippet
Use step outcome for diagnostics
Set the producer ID to tests. outcome reports pre-continue-on-error status.
github-actions
gitea-actions
data-flow
foundation
CICD-033
snippet
Avoid shell interpolation of event fields
Quoting treats the title as data. Keep untrusted strings out of shell source.
github-actions
gitea-actions
data-flow
foundation
CICD-034
snippet
Generate compact JSON for a matrix
Consume with fromJSON on the output. Raw multiline JSON breaks a single-line output protocol.
local-linux
github-actions
gitea-actions
data-flow
jq
foundation
CICD-035
snippet
Validate secret configuration without printing it
Use in a trusted deployment job only. Fork PRs may have no value.
github-actions
gitea-actions
data-flow
foundation
CICD-036
snippet
Test two Python releases
Install matrix.python in each job. Expect two independently visible results.
github-actions
gitea-actions
matrix
python
foundation
CICD-037
snippet
Matrix across operating systems
Use portable shell commands or explicit per-OS steps.
github-actions
gitea-actions
matrix
foundation
CICD-038
snippet
Exclude an incompatible combination
The matrix yields three jobs. Explain the omitted compatibility combination in the repository.
github-actions
gitea-actions
matrix
python
foundation
CICD-039
snippet
Include an independent experimental tuple
The experimental row provides evidence without weakening the supported row.
github-actions
gitea-actions
matrix
python
foundation
CICD-040
snippet
Retain failing matrix logs from other rows
A stable failure does not cancel the other active row.
github-actions
gitea-actions
matrix
foundation
CICD-041
snippet
Cap concurrent matrix jobs
Observe a maximum of two running rows per job strategy.
github-actions
gitea-actions
matrix
foundation
CICD-042
snippet
Give matrix artifact names unique suffixes
With two dimensions, both values must be present in the name.
github-actions
matrix
python
foundation
CICD-043
snippet
Split pytest by stable file set
Set SHARD from 0 through 3 and ensure one row contains every intended file exactly once. Use simple fixture filenames.
local-linux
github-actions
gitea-actions
matrix
pytest
foundation
CICD-044
snippet
Record matrix context safely
Use for non-secret matrix data. Compare output across rows.
github-actions
gitea-actions
matrix
foundation
CICD-045
snippet
Select a matrix from explicit JSON
Configure needs: plan on the job. A compact JSON object with at least one dimension is required.
github-actions
gitea-actions
matrix
foundation
CICD-046
snippet
Keep the required result after sharding
Protect this named check and prove a failed shard fails the aggregate.
github-actions
gitea-actions
matrix
foundation
CICD-047
snippet
Store a workflow at the Gitea entry point
Verify the workflow is tracked in the expected directory and compare it to Actions UI.
gitea-actions
gitea
gitea-foundation
foundation
CICD-048
snippet
Discover available runner labels
Generated labels are defaults. Check the running runner's configuration and server UI for authoritative state.
gitea-actions
gitea-foundation
foundation
CICD-049
snippet
Check Gitea access from a job
Use the URL reachable from the actual job container rather than 127.0.0.1 on the host.
gitea-actions
curl
gitea
foundation
CICD-050
snippet
Select an explicit external action source
Verify the trusted Gitea runner can reach and download this action. Prefer reviewed SHA pins in production.
gitea-actions
gitea-foundation
foundation
CICD-051
snippet
Verify default branch execution
Push a benign commit to main and check the trigger in the Gitea run details.
gitea-actions
gitea-foundation
foundation
CICD-052
snippet
Use uv with a committed lockfile
Dependency drift must fail instead of silently updating uv.lock.
gitea-actions
gitea-foundation
pytest
foundation
CICD-053
snippet
Check Gitea runner user and workspace
The ID means user identity in the executor, which can differ from the host.
gitea-actions
gitea-foundation
foundation
CICD-054
snippet
Read runner-local diagnostics
Run on the authorized runner host and scrub addresses or secrets before sharing logs.
gitea-actions
docker
gitea
foundation
CICD-055
snippet
Check container runtime availability
Run on the trusted host. Socket access indicates substantial privileges.
gitea-actions
docker
gitea-foundation
foundation
CICD-056
snippet
Preflight artifact support
Use only on a release that supports this artifact protocol. GitHub.com retired v3 and uses v4.
gitea-actions
gitea-foundation
foundation
CICD-057
snippet
Distinguish host DNS from job DNS
Run in a job and inspect resolver settings. Local multicast DNS commonly differs from container DNS.
gitea-actions
gitea
gitea-foundation
foundation
CICD-058
snippet
Install with pip hash verification
Lock transitive requirements and hashes before CI. A modified distribution is rejected.
local-linux
github-actions
gitea-actions
python
foundation
CICD-059
snippet
Require a current uv lock
Simulate a pyproject change and verify the check fails on stale lock state.
local-linux
github-actions
gitea-actions
python
uv
foundation
CICD-060
snippet
Run tests using uv
Ensure pytest is in the declared default dev group and test exact path discovery.
local-linux
github-actions
gitea-actions
pytest
python
foundation
Show 60 more (730 remaining)