This is a collection of reusable composite actions for GitHub Actions workflows.
- General usage
- Actions
We use semantic versioning. We will only push breaking changes to major updates. Minor versions are features, additions and improvements, and patch versions are bug fixes. We recommend using a major version.
Version | Constraint |
---|---|
v4 | >= v4.0.0 && < v5.0.0 |
v4.0 | >= v4.0.0 && < v4.1.0 |
v4.0.0 | v4.0.0 |
You can also use main
to always use the latest actions, but this is not
recommended as this will also include breaking changes.
- uses: myparcelnl/actions/yarn-install@v4
Will use every minor and patch update within v2.x.x
.
- uses: myparcelnl/actions/yarn-install@v4
Will use every patch update within v2.1.x
.
Generate credentials for a GitHub app.
- uses: myparcelnl/actions/setup-app-credentials@v4
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: namespace/any-other-action
with:
token: ${{ steps.setup-app-credentials.outputs.token }}
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | app-id |
The app ID of the app. | ${{ secrets.APP_ID }} |
– |
Yes | private-key |
The private key of the app. | ${{ secrets.APP_PRIVATE_KEY }} |
– |
As well as the inputs from actions/create-github-app-token@v1.
Name | Description | Example |
---|---|---|
name |
The name of the app. | my-app |
token |
The GitHub token of the app. | *** |
git-name |
The name to use with git. | my-app[bot] |
git-email |
The email to use with git. | my-app[bot]@users.noreply.github.com |
See also setup-git-credentials for setting up git using a GitHub app.
Generate credentials for a GitHub app. Uses [setup-app-credentials], then sets authentication data in git config and environment variables GIT_USER
, GIT_AUTHOR_NAME
, GIT_AUTHOR_EMAIL
, GIT_COMMITTER_NAME
and GIT_COMMITTER_EMAIL
.
- uses: myparcelnl/actions/setup-git-credentials@v4
id: credentials
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: namespace/any-other-action
with:
token: ${{ steps.credentials.outputs.token }}
The same inputs as setup-app-credentials.
The same outputs as setup-app-credentials.
Setup AWS credentials for use with other AWS actions.
- uses: myparcelnl/actions/aws-setup@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | aws-access-key-id |
The AWS access key ID. | ${{ secrets.AWS_ACCESS_KEY_ID }} |
– |
Yes | aws-secret-access-key |
The AWS secret access key. | ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
– |
Yes | aws-region |
The AWS region. | eu-west-1 |
– |
Sync a directory to an S3 bucket. Must be run after [aws-setup].
- uses: myparcelnl/actions/aws-setup@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- uses: myparcelnl/actions/aws-s3-sync@v4
with:
source: dist
bucket: my-bucket
delete: true
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | source |
The directory to sync. | dist |
– |
Yes | bucket |
Name of the S3 bucket to sync to. | ${{ secrets.AWS_BUCKET }} |
– |
No | delete |
Delete files that exist in the destination but not in the source during sync. | true |
false |
Uses [Volta] or actions/setup-node to set up Node.js. If Volta is present in the project, it will use the version from
volta.node
in package.json
. If Volta is not present, it will use the fallback version with actions/setup-node.
If node-version
is passed, it will use that version instead of Volta or the fallback version.
- uses: myparcelnl/actions/setup-node@v4
with:
# Omit to use Volta or fallback version.
node-version: 21
Includes the cache
and cache-dependency-path
inputs from actions/setup-node, which only apply when not using Volta.
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | node-version |
The Node.js version to use. Leave empty to use Volta version or fallback default version. (20) | 21 |
– |
Name | Description | Example |
---|---|---|
node-version |
The node version that is used. | 20.3.1 |
- Runs setup-node
- Handles
node_modules
cache - Runs
npm ci
- uses: myparcelnl/actions/npm-install@v4
with:
node-version: 20
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | node-version |
The Node.js version to use | 19 |
– |
Can be used with Yarn 1 as well as Yarn 2, 3 and 4 (berry).
- Runs setup-node
- Determines yarn arguments based on yarn version
- Runs
yarn install <your-args>
- uses: myparcelnl/actions/yarn-install@v4
with:
node-version: 20
yarn-args: --ignore-scripts
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | node-version |
The Node.js version to use | 19 |
– |
No | yarn-args |
Arguments to use with yarn install | --ignore-scripts |
|
- Runs setup-node
- Installs pnpm
- Handles pnpm cache
- Runs
pnpm install --frozen-lockfile
- uses: myparcelnl/actions/pnpm-install@v4
with:
node-version: 20
pnpm-version: 8.15.1
pnpm-args: --ignore-scripts --frozen-lockfile
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | node-version |
The Node.js version to use | 18 |
– |
No | pnpm-version |
The pnpm version to use | 7.4.0 |
8.15.1 |
No | pnpm-args |
Arguments to use with pnpm install | --ignore-scripts --frozen-lockfile |
--frozen-lockfile |
- Pulls
myparcelnl/php-xd
- You can change the php version by passing
php-version
.
- Handles composer cache
- Runs
composer install --no-interaction --no-progress
- You can add additional flags by passing the
flags
option.
- uses: myparcelnl/actions/composer-install@v4
with:
php-version: '8.0'
flags: --no-dev --no-plugins
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | command |
The command to run | update |
install |
No | flags |
Additional flags to pass to composer install |
--no-scripts |
--no-scripts --no-plugins |
No | php-version |
The PHP version to use | 8.0 |
7.2 |
Name | Description | Example |
---|---|---|
image |
The image name that was used to install dependencies. Can be used in subsequent jobs. | ghcr.io/myparcelnl/php-xd:7.4-cli-alpine |
- Runs composer-install with
command: update
.
- uses: myparcelnl/actions/composer-update@v4
with:
php-version: '8.0'
flags: --no-dev --no-plugins
Same as composer-install, but without command
.
Same as composer-install.
Run Behat through composer.
- Runs composer-install.
- Runs
vendor/bin/behat
in container.
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | image |
PHP Docker image to use | 8.1 |
7.4 |
No | php-version |
PHP version to use. If image is set, this will be ignored. | php:8.1 |
'' |
No | flags |
Additional flags to pass to Behat | --no-paths |
'' |
Run Pest through composer.
- Runs composer-install.
- Runs
vendor/bin/pest
in container.
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | image |
PHP Docker image to use | 8.1 |
7.4 |
No | php-version |
PHP version to use. If image is set, this will be ignored. | php:8.1 |
'' |
No | flags |
Additional flags to pass to Pest | --retry |
'' |
Run PHPStan through composer.
- Runs composer-install.
- Runs
vendor/bin/phpstan
in container.
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | command |
The PHPStan command to run. | analyse |
analyse |
No | config-file |
PHPStan configuration file | phpstan.neon |
'' |
No | cache-dir |
PHPStan cache directory | ./tmp/phpstan |
/tmp/phpstan |
No | cache-hash |
Hash to use for caching | ${{ hashFiles('src/**/*') }} |
${{ hashFiles('**/*.php') }} |
No | image |
PHP Docker image to use | php:8.1 |
'' |
No | php-version |
PHP version to use. If image is set, this will be ignored. | 8.1 |
7.4 |
Replacement for codecov/codecov-action that supports glob input in files
.
- Runs tj-actions/glob with the provided
files
input. - Runs codecov/codecov-action with the resolved files.
- uses: myparcelnl/actions/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit,frontend
files: |
frontend/**/coverage/*.xml
- uses: myparcelnl/actions/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit,backend
files: |
backend/**/coverage/*.xml
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | files |
Glob pattern or list of files to find coverage files | coverage/*.xml |
– |
No | excluded-files |
Excluded file patterns (optionally include ! before the file pattern or it would be prepended) |
!coverage/*.xml |
– |
The following inputs are copied from the codecov/codecov-action action:
token
flags
name
plugin
plugins
verbose
version
working-directory
Builds a docker image from a Dockerfile. Layers are cached and pruned between jobs based on git ref and tag.
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | image |
Image name | my-name/my-image |
${{ github.repository }} |
Yes | key |
Cache key | my-image-${{ hashFiles('Dockerfile') }} |
${{ github.workflow }} |
No | dockerfile |
Path to dockerfile | ./docker/prod.Dockerfile |
Dockerfile |
No | context |
Directory to build from | ./docker |
. |
No | docker-args |
Arguments to pass to docker build | --target prod |
|
No | prune-after |
Amount of time until which images get pruned | 24h |
260h (2 weeks) |
No | buildkit |
Whether to use Docker BuildKit | true |
false |
Name | Description | Example |
---|---|---|
tagged-image |
Created image name with tag | my-name/my-image:1639002200 |
tag |
Tag of the created image | 1639002200 |
- uses: myparcelnl/actions/build-docker-image@v4
id: docker
with:
image: myparcel/php-sdk
dockerfile: Dockerfile
context: .
docker-args: --target test
buildkit: true
- run: docker run ${{ steps.docker.outputs.tagged-image }}
Builds a docker image from a Dockerfile. Layers are cached and pruned between jobs using a registry.
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | image |
Image name | my-name/my-image |
${{ github.repository }} |
No | dockerfile |
Path to dockerfile | ./docker/prod.Dockerfile |
Dockerfile |
No | context |
Directory to build from | ./docker |
. |
No | target |
Target stage to build | prod |
– |
No | registry |
Packages registry to use | docker.io |
ghcr.io |
No | registry-username |
Username to log into registry with | ${{ secrets.DOCKER_REGISTRY_USER }} |
${{ github.actor }} |
Yes | registry-password |
Password to log into registry with | ${{ secrets.DOCKER_REGISTRY_PASS }} |
– |
Name | Description | Example |
---|---|---|
tagged-image |
Created image name with tag | my-name/my-image:1639002200 |
tag |
Tag of the created image | 1639002200 |
- uses: myparcelnl/actions/build-docker-image@v4
id: docker
with:
image: myparcel/php-sdk
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
- run: docker run ${{ steps.docker.outputs.tagged-image }}
Pulls and caches a docker image. Outputs the image name that was input to provide an easy way to not have to repeat the image name in the rest of your workflow.
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | image |
Image name | my-name/my-image |
– |
No | cache-directory |
Directory to store cache in | /path/to/cache |
~/.docker-cache |
Name | Description | Example |
---|---|---|
image |
Image name | my-name/my-image |
- uses: myparcelnl/actions/pull-docker-image@v4
id: pull
with:
image: ghcr.io/myparcelnl/php-xd:7.4
- run: docker run ${{ steps.pull.outputs.image }}
Run semantic-release. Requires npm dependencies to be installed. Outputs information on the release that was just made (or not). Additional tokens like NPM_TOKEN can be passed via the environment.
- uses: myparcelnl/actions/semantic-release@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
dry-run: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: 'Say "do something" if released'
if: steps.release.outputs.released == 'true'
#language=bash
run: |
echo "do something"
Note: In dry-run mode, no summary will be printed, even if
write-summary
is set totrue
.
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | token |
GitHub Personal access token | ${{ secrets.GITHUB_TOKEN }} |
– |
No | write-summary |
Write a summary to the GitHub action output | true |
false |
No | dry-run |
Run semantic release in dry-run mode | true |
false |
No | semantic-release-args |
Additional semantic release arguments | --debug |
– |
No | working-directory |
Directory to run semantic release in | ./packages/my-package |
– |
Name | Description | Example |
---|---|---|
version |
The version that was just released, prefixed with "v" | v1.2.3 |
previous-version |
The version before the release, prefixed with "v" | v1.2.2 |
version-number |
The version number that was just released | 1.2.3 |
previous-version-number |
The version number before the release | 1.2.2 |
release-type |
The type of the new release. Can be "major", "minor", "patch" or "none" | patch |
released |
Whether a new version was released | true |
- uses: myparcelnl/actions/yarn-install@v4
- uses: myparcelnl/actions/semantic-release@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
write-summary: true
semantic-release-args: --branches=my-branch
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: echo ${{ steps.release.outputs.version }}
Check if there are refs between two refs. Compares the last tag to HEAD by default. Returns true
if there are refs between the two, false
otherwise.
This can be used to check if a new release needs to be done, for example.
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: myparcelnl/actions/has-refs-between@v4
with:
ref-a: 'v2.0.0'
ref-b: 'main'
Required | Name | Description | Example | Default |
---|---|---|---|---|
false | ref-a |
The first ref | v2.0.0 |
last-tag (resolved to last tag) |
false | ref-b |
The second ref | main |
HEAD |
Name | Description | Example |
---|---|---|
has-refs |
Whether there are refs between ref A and B | true or false |
Set up git credentials and authenticate as a GitHub app.
- uses: myparcelnl/actions/setup-git-credentials@v4
with:
app-id: ${{ secrets.GITHUB_APP_ID }}
private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
Required | Name | Description | Example | Default |
---|---|---|---|---|
true | app-id |
The app ID of the app. | ${{ secrets.APP_ID }} |
– |
true | private-key |
The private key of the app. | ${{ secrets.APP_PRIVATE_KEY }} |
– |
Name | Description | Example |
---|---|---|
name |
The name of the app. | my-app |
token |
The GitHub token of the app. | ghp_1234567890 |
git-name |
The name to use with git. | my-app[bot] |
git-email |
The email to use with git. | my-app[bot]@users.noreply.github.com |
Rebase two branches and push.
This action uses the App inputs, as well as the following:
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | target |
Target branch you wish to update. | develop |
– |
Yes | base |
Base branch to use to rebase target. | main |
– |
No | force |
Force push. | true |
false |
No | remote |
The remote to use | upstream |
origin |
No | continue-on-error |
Continue when rebasing fails | false |
true |
- uses: myparcelnl/actions/rebase@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
target: develop
force: true
remote: upstream
continue-on-error: false
Update git tags to keep major and minor version in sync. Good for releasing GitHub actions.
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | minor |
Update the major version. | true |
true |
No | major |
Update the minor version. | true |
false |
- uses: myparcelnl/actions/update-tags@v4
with:
minor: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This takes the tag on the current commit, for example v2.3.1
after
running semantic-release, and parses it to determine which tags should be
updated.
If run with minor: true
:
- Will add
v2
to the current commit - Will add
v2.3
to the current commit
If run without minor: true
, or with minor: false
:
- Will add
v2
to the current commit.
Check if there are new commits in head that are not in base.
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | base |
The base branch to compare against | main |
main |
No | head |
The branch to check for new commits | feat/my-feature |
develop |
No | remote |
The remote to use | upstream |
origin |
Name | Description | Example |
---|---|---|
diff |
Whether the branches are different | true |
commits |
List of commits in head that are not in base | • fix: fix a bug (3 days ago) |
compare-url |
Link to the compare view of both commits | https://github.com/myparcelnl/woocommerce/compare/main..develop |
Gets a GitHub token to use in the workflow. If token
is passed, it will be used. Otherwise, an app token will be
generated. Either token
or app-id
and private-key
must be passed.
Meant for use within other actions, because obviously you could just use the token
input directly.
- uses: myparcelnl/actions/get-github-token@v4
id: passed-token
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: myparcelnl/actions/get-github-token@v4
id: generated-token
with:
app-id: ${{ secrets.GITHUB_APP_ID }}
private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
- run: echo ${{ steps.passed-token.outputs.token }} # The GitHub token that was passed in.
- run: echo ${{ steps.generated-token.outputs.token }} # The GitHub token that was generated.
This action uses the App inputs.
Name | Description | Example |
---|---|---|
token |
The GitHub token. | *** |
Assign the author of a pull request to the pull request. For use with the pull_request
event.
- uses: myparcelnl/actions/pr-assign-author@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Or, if you want to use a GitHub app:
- uses: myparcelnl/actions/pr-assign-author@v4
with:
app-id: ${{ secrets.GITHUB_APP_ID }}
private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
See App inputs
Label a pull request based on the review state. For use with the pull_request_review
event.
- Gets the amount of reviews needed.
- Uses
inputs.reviews-required
if passed. - If this input does not exist, the action will get the data via branch protections. You'll need an app or access
token with the
read settings
permission for this.
- Calculates whether the PR is approved or changes are requested.
- Labels the PR accordingly, removing labels that are no longer relevant.
- If the PR is approved:
inputs.label-approved
is added,inputs.label-changes-requested
is removed if it exists. - If changes are requested:
inputs.label-changes-requested
is added,inputs.label-approved
is removed if it exists. - If the PR is not approved and no changes are requested:
inputs.label-approved
andinputs.label-changes-requested
are removed if they exist.
- uses: myparcelnl/actions/pr-label-by-review@v4
with:
# Either a GitHub token or a GitHub app is required.
token: ${{ secrets.GITHUB_TOKEN }}
# Omit `token` and pass the following if you want to use a GitHub app:
app-id: ${{ secrets.GITHUB_APP_ID }}
private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
label-approved: 'yay' # The label to add when the PR is approved.
label-changes-requested: 'nay' # The label to add when changes are requested.
required-approvals: 2 # The number of reviews required to merge the PR. Should be passed only if you don't have an access token or app with the read settings permission.
branch-protections: 'rulesets' # Whether to use branch protection or rulesets to determine the number of required reviews.
This action uses the App inputs, as well as the following:
Required | Name | Description | Example | Default |
---|---|---|---|---|
false | required-approvals |
The number of reviews required to merge the PR. Can be passed if you don't have an access token or app with the read settings permission. | 2 |
– |
false | label-approved |
The label to add when the PR is approved. | ready to merge |
approved |
false | label-changes-requested |
The label to add when changes are requested. | needs work |
changes requested |
false | branch-protection |
Whether to use branch protection or rulesets to determine the number of required reviews. | rulesets |
branch-protection |
Post an artifact to a pull request. For use with the workflow_run
event with completed
type. Shows either success with link to artifact or failure depending on the outcome of the workflow.
Requires the referenced workflow to have produced an artifact using the actions/upload-artifact
action.
name: 'Post PR Artifacts'
on:
workflow_run:
types:
- completed
workflows:
- 'My PR Workflow' # The name of the workflow that produces the artifact
jobs:
comment-success:
runs-on: ubuntu-22.04
steps:
- uses: myparcelnl/actions/pr-post-artifacts@v4
with:
app-id: ${{ secrets.GITHUB_APP_ID }}
private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
Required | Name | Description | Example | Default |
---|---|---|---|---|
false | app-id |
The app ID of the app. | ${{ secrets.APP_ID }} |
– |
false | private-key |
The private key of the app. | ${{ secrets.APP_PRIVATE_KEY }} |
– |
Validate the title of a pull request based on the conventional commit format. For use with the pull_request
event.
- uses: myparcelnl/actions/pr-validate-title-conventional@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Or, if you want to use a GitHub app:
- uses: myparcelnl/actions/pr-validate-title-conventional@v4
with:
app-id: ${{ secrets.GITHUB_APP_ID }}
private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
This action uses the App inputs.
Name | Description | Example |
---|---|---|
success |
Whether the PR title is valid. | true |
error |
Error in case the PR title is not valid. | (string containing the error) |
Wraps peter-evans/rebase
with the ability to use a GitHub app easily.
- Uses [get-github-token] to get a token.
- Passes the token and other inputs to
peter-evans/rebase
.
This action uses the App inputs, as well as the inputs from the original action.
Wraps peter-evans/repository-dispatch
with the ability to use a GitHub app easily.
Usage is the same as the original action, but with the addition of the app-id
and private-key
inputs.
- Uses [get-github-token] to get a token.
- Passes the token and other inputs to
peter-evans/repository-dispatch
.
This action uses the App inputs, as well as the inputs from the original action.
Mark issues and pull requests as stale after a period of inactivity. For use with the schedule
event.
- uses: myparcelnl/actions/stale@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-pr-stale: 30
This action uses the App inputs, as well as the following:
Required | Name | Description | Example | Default |
---|---|---|---|---|
false | days-before-stale |
Amount of days before an issue is marked as stale. | 14 |
60 |
false | days-before-issue-stale |
Amount of days before an issue is marked as stale. | 14 |
– (inherit) |
false | days-before-pr-stale |
Amount of days before a pull request is marked as stale. | 30 |
– (inherit) |
false | days-before-issue-close |
Amount of days before an issue is closed. | 7 |
14 |
false | days-before-pr-close |
Amount of days before a pull request is closed. | 14 |
-1 (never) |
Name | Description | Example |
---|---|---|
staled-issues-prs |
List of all staled issues and pull requests. | [#1, #2, #3] |
closed-issues-prs |
List of all closed issues and pull requests. | [#1, #2, #3] |
Toggle a label on a pull request on or off based on a boolean input, or automatically if toggle
is omitted. For use
with the pull_request
event.
- uses: myparcelnl/actions/toggle-label@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
label: 'failing tests'
toggle: ${{ steps.tests.outputs.failed }}
This action uses the App inputs, as well as the following:
Required | Name | Description | Example | Default |
---|---|---|---|---|
true | label |
The label to toggle. | failing tests |
– |
true | toggle |
Whether to toggle the label on or off. | true |
auto |
Create or update a comment on an issue or pull request.
- uses: myparcelnl/actions/create-or-update-comment@v4
with:
app-id: ${{ secrets.GITHUB_APP_ID }}
private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
identifier: 'my-unique-id'
body: |-
This is a comment.
It can be multiline.
issue-number: 123
# When omitted, comment-id will be searched for based on the identifier.
comment-id: 123456789
This action uses the App inputs (without token
), as well as the following:
Required | Name | Description | Example | Default |
---|---|---|---|---|
true | body |
The body of the comment. | failing tests |
– |
false | identifier |
Hidden identifier to update the comment. | my-unique-id |
– |
false | issue-number |
The issue number to comment on. | 123 |
– |
false | comment-id |
The comment ID to update. | 123456789 |
– |
Name | Description | Example |
---|---|---|
comment-id |
The ID of the comment that was created or updated | 572389429 |
Save and restore the Nx cache.
- Runs [actions/cache] and caches
./.nx/cache
(default)
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | cache-directory |
The nx cache directory | ./path/to/nx/cache |
.nx/cache |
No | max-cache-size |
Maximum size of the nx cache in KB | 4096 |
8192 |
Run nx run
with the provided arguments.
- Runs [nx-cache]
- Runs
<prefix> nx run <target> <args>
.
- uses: myparcelnl/actions/nx-run@v4
with:
target: 'my-project:build'
prefix: 'yarn'
args: '--runner=cloud'
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | target |
The target to run. | my-project:build |
- |
No | prefix |
The prefix to use with nx . |
yarn |
npx |
No | args |
Arguments to pass to the command. | --runner=cloud |
- |
No | cache-directory |
The nx cache directory | ./path/to/nx/cache |
.nx/cache |
No | max-cache-size |
Maximum size of the nx cache in KB | 4096 |
8192 |
Run nx run-many
with the provided arguments.
- Runs [nx-cache]
- Runs
<prefix> nx run-many <args> --target=<target>
.
- uses: myparcelnl/actions/nx-run-many@v4
with:
target: 'build'
prefix: 'yarn'
args: '--all --runner=cloud'
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | target |
The target to run. | build |
- |
No | prefix |
The prefix to use with nx . |
yarn |
npx |
No | args |
Arguments to pass to the command. | --all --runner=cloud |
- |
No | cache-directory |
The nx cache directory | ./path/to/nx/cache |
.nx/cache |
No | max-cache-size |
Maximum size of the nx cache in KB | 4096 |
8192 |
Setup Bun and install dependencies.
- Runs oven-sh/setup-bun
- Caches bun cache folder
- Installs dependencies with
bun install <bun-args>
- uses: myparcelnl/actions/bun-install@v4
with:
bun-version: 1.0.0
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | bun-version |
The Bun version to install | latest |
1.0.0 |
No | bun-args |
Arguments to pass to bun install | --no-progress |
--frozen-lockfile |
Run BundleWatch to check the size of your bundles. You will need to provide a [BundleWatch token] and a configuration.
If you don't pass the config
input, it will look for the bundlewatch
key in your package.json
.
- uses: myparcelnl/actions/bundlewatch@v4
with:
config: .bundlewatch.json
token: ${{ secrets.BUNDLEWATCH_TOKEN }}
Required | Name | Description | Example | Default |
---|---|---|---|---|
No | config | Path to the BundleWatch config file. | .bundlewatch.json |
– |
Yes | token | BundleWatch token to use. | ${{ secrets.BUNDLEWATCH_TOKEN }} |
– |
Create cache keys for use with [actions/cache].
- uses: myparcelnl/actions/create-cache-keys@v4
id: keys
with:
key: '${{ runner.os }}-composer'
input: |
7.4
${{ hashFiles('composer.json', 'composer.lock') }}
- uses: actions/cache@v4
with:
path: some-path
key: ${{ steps.keys.outputs.key }} # Linux-composer-7.4-<hash>
restore-keys: ${{ steps.keys.outputs.restore-keys }} # Linux-composer-7.4-, Linux-composer- (as multiline string)
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | key |
The base key for the cache | composer |
– |
No | input |
Input list to use for generating the cache key | 7.4 |
'' |
No | restore-keys |
Number of restore keys. Set to 0 to disable restore keys | 2 |
auto |
Name | Description | Example |
---|---|---|
cache-key |
The generated cache key | composer-7.4-1234567890-bla |
restore-keys |
The generated restore keys | composer-7.4-1234567890-\ncomposer-7.4- |
Mark something as deprecated. This will add a warning to the workflow run.
- uses: myparcelnl/actions/deprecated@v4
with:
name: 'my-name/my-action'
replacement: 'my-name/my-new-action'
reason: 'It is no longer maintained.'
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | name |
Name of the thing to mark as deprecated | my-name/my-action |
– |
No | replacement |
The replacement | my-name/my-new-action |
– |
No | reason |
The reason why it is deprecated | It is no longer maintained. |
– |
Hash a string. Input can be string, multiline string or empty. If input string is empty, an empty string will be returned. If input string is multiline, the lines will be sorted, deduplicated and hashed. The string that is hashed will be output as string
.
- uses: myparcelnl/actions/hash-string@v4
id: hash
with:
method: 'sha256sum'
string: 'my-string'
# or
string: |
my
multiline
string
- run: echo ${{ steps.hash.outputs.string }} // multiline my string
- run: echo ${{ steps.hash.outputs.hash }} // bdfe7443bc0ddf3fb21a2c407e876458d04a5931b16259cbd727f7fd6ac4ef3b
Required | Name | Description | Example | Default |
---|---|---|---|---|
Yes | string |
The string to hash. Can be empty or multiple lines. | my string |
– |
No | method |
The hashing method to use. | sha256sum |
md5sum |
Name | Description | Example |
---|---|---|
hash |
The hashed string, empty if no string was provided. | c403c22aac54783366d90df0bbdadc1a |
string |
The string that was hashed. | `my string to hash' |
Many of these actions can use either a GitHub token or a GitHub app. If you want to use a GitHub app, you can pass the app-id
and private-key
inputs. The app will then be used to authenticate with GitHub.
These inputs apply on top of the other inputs of the action that allows for GitHub app authentication.
Required | Name | Description | Example | Default |
---|---|---|---|---|
false | token |
GitHub token to use. If passed, takes precedence over the app-id and app-private-key inputs. |
${{ secrets.GITHUB_TOKEN }} |
– |
false | app-id |
The app ID of the app. | ${{ secrets.APP_ID }} |
– |
false | private-key |
The private key of the app. | ${{ secrets.APP_PRIVATE_KEY }} |
– |