Template repository for GitHub Actions
10K+
Template repository for GitHub Actions
Check also other actions from DevOps-Infraโ
This action supports three tag levels for flexible versioning:
vX: latest patch of the major version (e.g., v1).vX.Y: latest patch of the minor version (e.g., v1.2).vX.Y.Z: fixed to a specific release (e.g., v1.2.3). - name: Run the Action
uses: devops-infra/[email protected]
env:
barfoo: foobaz
with:
foobar: bazbar
debug: false
# github_token: ${{ secrets.GITHUB_TOKEN }}
| Variable | Description |
|---|---|
barfoo | Sample environment variable. |
| Input | Required | Default | Description |
|---|---|---|---|
foobar | No | foobar | Sample input used by the action. |
debug | No | false | Enable verbose debug logging. |
github_token | No | For authenticated GitHub requests. |
| Output | Description |
|---|---|
foobar | Echo of provided foobar input. |
barfoo | Duplicate of foobar for demo use. |
Run the Action with defaults.
name: Run the Action on each commit
on: [push]
jobs:
template-action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: devops-infra/template-action@v1
Run the Action with set inputs.
name: Run the Action on each commit
on: [push]
jobs:
template-action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: devops-infra/template-action@v1
with:
foobar: hello
debug: 'true'
Pick the tag level based on your stability needs:
vX.Y.Z: exact immutable release (most predictable)vX.Y: latest patch within one minor linevX: latest patch within one major linename: Run the Action on each commit
on: [push]
jobs:
template-action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: devops-infra/[email protected]
id: Pin patch version
- uses: devops-infra/[email protected]
id: Pin minor version
- uses: devops-infra/template-action@v1
id: Pin major version
Workflows included:
.github/workflows/auto-pull-request-create.yml)
master and dependabot/**..github/workflows/auto-create-release.yml)
pull_request closed and push to release/** (runs only for merged PRs from release/)vX.Y.Z; update vX.Y and vX (fails if full tag exists on remote).github/workflows/cron-dependency-update.yml)
.github/workflows/manual-release-create.yml)
workflow_dispatch with type (patch|minor|major|set) xor version when type=set
pushes to release/** branch and creates a pull request to create a new releaseREL_VERSIONPrerequisites:
brew install gnu-sed),Common tasks:
# Run all linters
task lint
# Build multi-arch images locally (no push)
task docker:build
# Push images (requires DOCKER_TOKEN and GITHUB_TOKEN)
DOCKER_TOKEN=... GITHUB_TOKEN=... task docker:push
Pre-commit hooks:
brew install pre-commit
task pre-commit:install
task pre-commit
Contributions are welcome! See CONTRIBUTINGโ . This project is licensed under the MIT License - see the LICENSEโ file for details.
This project is licensed under the MIT License - see the LICENSEโ file for details.
If you have any questions or need help, please:
Template action E2E validation is now part of the centralized org flow.
Manual execution options:
.github/workflows/manual-e2e-validate.ymldevops-infra/triglav/.github/workflows/e2e-action-template-action.ymlExecution modes:
mode=ref validates ref-oriented E2E paths against stable pinned action refs.mode=image is wired but currently placeholder-only in the central E2E workflow for this action.Example trigger inputs:
mode=ref
mode=image
image_tag=v1.2.3-test
To publish images from a fork, set these variables so Task uses your registry identities:
DOCKER_USERNAME, DOCKER_ORG_NAME, GITHUB_USERNAME, GITHUB_ORG_NAME.
Two supported options (environment variables take precedence over .env):
# .env (local only, not committed)
DOCKER_USERNAME=your-dockerhub-user
DOCKER_ORG_NAME=your-dockerhub-org
GITHUB_USERNAME=your-github-user
GITHUB_ORG_NAME=your-github-org
# Shell override
DOCKER_USERNAME=your-dockerhub-user \
DOCKER_ORG_NAME=your-dockerhub-org \
GITHUB_USERNAME=your-github-user \
GITHUB_ORG_NAME=your-github-org \
task docker:build
Recommended setup:
.env file.DOCKER_TOKEN and GITHUB_TOKEN.Publish images without a release:
(Manual) Release Create workflow with build_only: true to build and push images without tagging a release.Content type
Image
Digest
sha256:dd618c7fcโฆ
Size
4.8 MB
Last updated
4 months ago
docker pull devopsinfra/template-actionPulls:
156
Last week