Github Action
Description
The github/action crawler looks recursively for workflow files and Composite Actions, then tries to update every action reference found in them.
It scans two kinds of file:
Workflows - files matching
.yamlor.ymllocated directly inside aworkflowsdirectory whose parent is.github,.gitea, or.forgejo.Composite Actions - files named
action.yamloraction.yml, in any directory.
Despite its name, the crawler is not GitHub-only: .gitea/workflows and .forgejo/workflows are scanned as well, and the provider is detected from each action reference.
This crawler is enabled by default, so it can be used either automatically by running updatecli diff from a directory containing the files to update, or by providing a manifest.
The automatic discovery behavior can be tuned by providing a YAML manifest with a github/action crawler in top-level directive autodiscovery as explained in the "Autodiscovery" page.
Note | The crawler key is github/action. The alias gitea/action maps to the same implementation, but it is not part of the default crawlers, so it only runs when explicitly declared. |
Generated manifests
Action references are updated in place with a yaml target. The source depends on the provider and on the shape of the reference:
| Reference | Sources used |
|---|---|
| |
| |
| |
| Skipped - local actions have no upstream to track. |
Digest pinning
digest defaults to true, so generated manifests pin references to an immutable digest and keep the human-readable version as a trailing comment:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1Set digest: false to write the tag or branch directly instead.
Important | Digest pinning is only implemented for GitHub Actions and Docker image references. Gitea and Forgejo actions are always updated to a tag or branch. |
Authentication
Discovery queries the provider’s API, so unauthenticated runs are rate limited and private repositories are invisible.
Tokens are resolved per hostname, from credentials, from a GitHub App configuration, or from the environment:
GitHub:
UPDATECLI_GITHUB_TOKEN, thenGITHUB_TOKENGitea and Forgejo:
UPDATECLI_GITEA_TOKEN, thenGITEA_TOKEN
gitea.com, codeberg.org, and code.forgejo.org are recognised as Gitea automatically. Any other unknown hostname falls back to GitHub.
Use credentialsdocker to authenticate against a private registry when resolving docker:// references.
Limitations
filesmatches the file name only, not a path. Patterns such as.github/workflows/.yamlmatch nothing; use.yamlorci.yaml. The directory is constrained separately, to.github,.gitea, or.forgejoworkflow directories.actionsfilters Composite Actions by the name of the directory containingaction.yaml, not by the file path.Workflow files that are not directly inside a
workflowsdirectory are ignored.
Manifest
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| actions | array | actions allows to specify the accepted Composite Action names A Composite Action is identified by an “action.yaml” or “action.yml” file, and the pattern is matched against the name of the directory containing it. default: | |
| credentials | object | Credentials allows to specify the credentials to use to authenticate to the git provider The ID of the credential must be the domain of the git provider to configure default: empty examples: | |
| app | object | ||
| clientid | string | ClientID represents the GitHub App client ID | |
| expirationtime | string | Expiration represents the token expiration time in seconds The token is used during the entire execution of updatecli and should be valid for the entire duration of the run The minimum value is 600 seconds (10 minutes) Default: 3600 (1 hour) | |
| installationid | string | InstallationID represents the GitHub App installation ID
It is the same ID that you can find in the GitHub endpoint:
https://github.com/settings/installation/ | |
| privatekey | string | PrivateKey represents a PEM encoded private key It is recommended to use PrivateKeyPath instead of PrivateKey to avoid putting sensitive information in the configuration file If both PrivateKey and PrivateKeyPath are set, PrivateKey takes precedence | |
| privatekeypath | string | PrivateKeyPath represents the path to a PEM encoded private key If both PrivateKey and PrivateKeyPath are set, PrivateKey takes precedence It is recommended to use an environment variable to set the PrivateKeyPath value e.g. PrivateKeyPath: {{ requiredEnv “GITHUB_APP_PRIVATE_KEY_PATH” }} to avoid putting sensitive information in the configuration file | |
| kind | string | ||
| token | string | ||
| credentialsdocker | object | CredentialsDocker provides a map of registry credentials where the key is the registry URL without scheme | |
| password | string | password specifies the container registry password to use for authentication. Not compatible with token compatible: * source * condition * target default:
by default credentials are fetch from the local environment such as remark: Not compatible with token | |
| token | string | token specifies the container registry token to use for authentication. compatible: * source * condition * target default:
by default credentials are fetch from the local environment such as remark: Not compatible with username/password | |
| username | string | username specifies the container registry username to use for authentication. compatible: * source * condition * target default:
by default credentials are fetch from the local environment such as remark: Not compatible with token | |
| digest | boolean | Digest provides parameters to specify if the generated manifest should use a digest instead of the branch or tag. Remark: - The digest is only supported for GitHub Action and docker image tag update. Feel free to open an issue for the Gitea and Forgejo integration. | |
| files | array | files allows to specify the accepted Action workflow file name The pattern is matched against the file name only, not against its path, so a pattern such as “.github/workflows/*.yaml” never matches. The directory is constrained separately: a workflow file must sit directly inside a “workflows” directory whose parent is “.github”, “.gitea”, or “.forgejo”. default: | |
| ignore | array | ignore allows to specify rule to ignore autodiscovery a specific GitHub action based on a rule default: empty | |
| actions | object | Actions specifies the list of artifacts to check The key is the artifact name and the value is the artifact version The artifact name must match the GitHub action name or the Docker image name. In case of a Docker image, it must have the prefix docker:// If the value is empty, then the artifact name is enough to match If the value is a valid Git branch, Git tag, release, a Docker image tag , then the artifact version must match the constraint | |
| path | string | Path specifies a Flux filepath pattern, the pattern requires to match all of name, not just a subpart of the path. | |
| only | array | only allows to specify rule to only autodiscover manifest for a specific GitHub action based on a rule default: empty | |
| actions | object | Actions specifies the list of artifacts to check The key is the artifact name and the value is the artifact version The artifact name must match the GitHub action name or the Docker image name. In case of a Docker image, it must have the prefix docker:// If the value is empty, then the artifact name is enough to match If the value is a valid Git branch, Git tag, release, a Docker image tag , then the artifact version must match the constraint | |
| path | string | Path specifies a Flux filepath pattern, the pattern requires to match all of name, not just a subpart of the path. | |
| rootdir | string | rootDir allows to specify the root directory from where looking for GitHub Action default: empty | |
| versionfilter | object |
kind - semver
versionfilter of kind kind - regex
versionfilter of kind example: and its type like regex, semver, or just latest. More examples can be found at https://www.updatecli.io/docs/core/versionfilter/ | |
| kind | string | specifies the version kind such as semver, regex, or latest | |
| pattern | string | specifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format | |
| regex | string | specifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used. | |
| replaceall | object | replaceAll applies a regex replacement to version strings before filtering. This is useful for transforming versions (e.g., curl-8_15_0 to curl-8.15.0) before regex extraction. | |
| pattern | string | Pattern specifies the regex pattern to match for replacement | |
| replacement | string | Replacement specifies the replacement string (supports $1, $2, etc. for captured groups) | |
| strict | boolean | strict enforce strict versioning rule. Only used for semantic versioning at this time |
Note | Each entry of credentials is keyed by the git provider hostname, and accepts kind (github, gitea, or forgejo) along with a token or a GitHub App configuration. |
Example
Basic Example
# updatecli.d/default.yaml
name: "githubaction autodiscovery"
scms:
default:
kind: git
spec:
url: https://github.com/updatecli/updatecli.git
branch: "main"
autodiscovery:
scmid: default
crawlers:
github/action:
digest: true
rootdir: ".github"
Multiple providers
# updatecli.d/github-action-providers.yaml
autodiscovery:
crawlers:
github/action:
# Pin to a tag or branch rather than a digest
digest: false
credentials:
"github.com":
kind: github
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
"codeberg.org":
kind: forgejo
token: '{{ requiredEnv "FORGEJO_TOKEN" }}'
versionfilter:
kind: semver
pattern: minorImportant | Crawler settings are declared directly under the crawler key. An extra spec: level is accepted by the parser but silently ignored, leaving every setting at its default. |