Skip to content

Our collection of reusable GitHub actions

Notifications You must be signed in to change notification settings

myparcelnl/actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Actions

GitHub tag (latest by date)

This is a collection of reusable composite actions for GitHub Actions workflows.

Overview

General usage

Versioning

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.

Major example

- uses: myparcelnl/actions/yarn-install@v4

Will use every minor and patch update within v2.x.x.

Minor example

- uses: myparcelnl/actions/yarn-install@v4

Will use every patch update within v2.1.x.

Actions

Authentication

setup-app-credentials

Source

Generate credentials for a GitHub app.

Example
- 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 }}
Inputs
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.

Outputs
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.

setup-git-credentials

Source

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.

Example
- 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 }}
Inputs

The same inputs as setup-app-credentials.

Outputs

The same outputs as setup-app-credentials.

AWS

aws-setup

Source

Setup AWS credentials for use with other AWS actions.

Example
- 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
Inputs
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

aws-s3-sync

Source

Sync a directory to an S3 bucket. Must be run after [aws-setup].

Example
- 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
Inputs
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

Node

setup-node

Source

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.

Example
- 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.

Inputs
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
Outputs
Name Description Example
node-version The node version that is used. 20.3.1

npm-install

Source

  1. Runs setup-node
  2. Handles node_modules cache
  3. Runs npm ci
Example
- uses: myparcelnl/actions/npm-install@v4
  with:
    node-version: 20
Inputs
Required Name Description Example Default
No node-version The Node.js version to use 19

yarn-install

Can be used with Yarn 1 as well as Yarn 2, 3 and 4 (berry).

Source

  1. Runs setup-node
  2. Determines yarn arguments based on yarn version
  3. Runs yarn install <your-args>
Example
- uses: myparcelnl/actions/yarn-install@v4
  with:
    node-version: 20
    yarn-args: --ignore-scripts
Inputs
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

pnpm-install

Source

  1. Runs setup-node
  2. Installs pnpm
  3. Handles pnpm cache
  4. Runs pnpm install with the provided arguments and --frozen-lockfile by default.
Example
- uses: myparcelnl/actions/pnpm-install@v4
  with:
    node-version: 20
    pnpm-version: 8.15.1
    pnpm-args: |
      --ignore-scripts
      --store-dir /tmp/pnpm-store
Inputs
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. Can be multiline string. --ignore-scripts

PHP

composer-install

Source

  1. Pulls myparcelnl/php-xd
  • You can change the php version by passing php-version.
  1. Handles composer cache
  2. Runs composer install with passed arguments
  • You can add additional flags by passing the composer-args option.
Example
- uses: myparcelnl/actions/composer-install@v4
  with:
    php-version: '8.0'
    composer-args: |
      --no-dev
      --no-plugins
Inputs
Required Name Description Example Default
No command The command to run update install
No composer-args 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

Outputs

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

composer-update

Source

  1. Runs composer-install with command: update.
Example
- uses: myparcelnl/actions/composer-update@v4
  with:
    php-version: '8.0'
    composer-args: |
      --no-dev
      --no-plugins
Inputs

Same as composer-install, but without command.

Outputs

Same as composer-install.

composer-behat

Source

Run Behat through composer.

  1. Runs composer-install or uses the provided image.
  2. Runs vendor/bin/behat in container.
Inputs
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
No php-args Arguments to pass to PHP. Should be a multiline string. -dmemory_limit=2G
No behat-args Arguments to pass to Behat. Should be a multiline string. --tags=@api

composer-pest

Source

Run Pest through composer.

  1. Runs composer-install.
  2. Runs vendor/bin/pest in container.
Inputs
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 php-args Arguments to pass to PHP. Should be a multiline string. -dpcov.enabled=0
No pest-args Arguments to pass to Pest. Should be a multiline string. --retry

composer-phpstan

Source

Run PHPStan through composer.

  1. Runs composer-install or uses the provided image.
  2. Runs vendor/bin/phpstan in container.
Inputs
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
No php-args Arguments to pass to PHP. Should be a multiline string. -dpcov.enabled=0
No phpstan-args Arguments to pass to PHPStan. Should be a multiline string. --level=7

Testing

codecov-coverage

Source

Replacement for codecov/codecov-action that supports glob input in files.

  1. Runs tj-actions/glob with the provided files input.
  2. Runs codecov/codecov-action with the resolved files.
Example
- uses: myparcelnl/actions/codecov-coverage@v4
  with:
    token: ${{ secrets.CODECOV_TOKEN }}
    flags: unit,frontend
    files: |
      frontend/**/coverage/*.xml

- uses: myparcelnl/actions/codecov-coverage@v4
  with:
    token: ${{ secrets.CODECOV_TOKEN }}
    flags: unit,backend
    files: |
      backend/**/coverage/*.xml
Inputs
Required Name Description Example Default
No files Glob pattern or list of files to find results files, separated by newlines coverage/*.xml

The following inputs are copied from the codecov/codecov-action action:

  • token
  • flags
  • name
  • plugin
  • plugins
  • version
  • working-directory

codecov-test-results

Source

Replacement for codecov/test-results-action that supports glob input in files.

  1. Runs tj-actions/glob with the provided files input.
  2. Runs codecov/test-results-action with the resolved files.
Example
- uses: myparcelnl/actions/codecov-test-results@v4
  with:
    token: ${{ secrets.CODECOV_TOKEN }}
    flags: unit,frontend
    files: |
      frontend/**/junit.xml

- uses: myparcelnl/actions/codecov-test-results@v4
  with:
    token: ${{ secrets.CODECOV_TOKEN }}
    flags: unit,backend
    files: |
      backend/**/junit.xml
Inputs
Required Name Description Example Default
No files Glob pattern or list of files to find results files, separated by newlines **/junit.xml

The following inputs are copied from the codecov/test-results-action action:

  • token
  • flags
  • name
  • version
  • working-directory

Docker

build-docker-image

Source

Builds a docker image from a Dockerfile. Build results are cached between jobs using mode=gha.

Inputs
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 }}
Outputs

Also outputs version, tags, labels, annotations, json from docker/metadata-action.

Name Description Example
tagged-image Created image name with tag my-name/my-image:main
Example
- uses: myparcelnl/actions/build-docker-image@v4
  id: docker
  with:
    image: myparcelnl/php-sdk
    registry-username: ${{ github.actor }}
    registry-password: ${{ secrets.GITHUB_TOKEN }}

- run: docker run ${{ steps.docker.outputs.tagged-image }}

pull-docker-image

Source

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.

Inputs
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
Outputs
Name Description Example
image Image name my-name/my-image
Example
- 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 }}

Releasing

semantic-release

Source

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.

Example
- 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 to true.

Inputs
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 false true
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
Outputs
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
Example
- uses: myparcelnl/actions/yarn-install@v4

- uses: myparcelnl/actions/semantic-release@v4
  id: release
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    write-summary: false
    semantic-release-args: --branches=my-branch
  env:
    NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: echo ${{ steps.release.outputs.version }}

Git

has-refs-between

Source

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.

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'
Inputs
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
Outputs
Name Description Example
has-refs Whether there are refs between ref A and B true or false

setup-git-credentials

Source

Set up git credentials and authenticate as a GitHub app.

Example
- uses: myparcelnl/actions/setup-git-credentials@v4
  with:
    app-id: ${{ secrets.GITHUB_APP_ID }}
    private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}
Inputs
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 }}
Outputs
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

Source

Rebase two branches and push.

Inputs

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
Example
- uses: myparcelnl/actions/rebase@v4
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    base: main
    target: develop
    force: true
    remote: upstream
    continue-on-error: false

update-tags

Source

Update git tags to keep major and minor version in sync. Good for releasing GitHub actions.

Inputs
Required Name Description Example Default
No minor Update the major version. true true
No major Update the minor version. true false
Example
- 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.

compare-branches

Source

Check if there are new commits in head that are not in base.

Inputs
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
Outputs
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

GitHub

find-artifact

Source

Find an artifact in a repository. Returns the ID of the artifact if it exists.

Example
- uses: myparcelnl/actions/find-artifact@v4
  id: artifact
  with:
    artifact-name: my-artifact
    repository: myparcelnl/actions
    per-page: 10
    max-age: 12 # hours
Inputs

This action uses the App inputs, as well as the following:

Required Name Description Example Default
Yes artifact-name The name of the artifact to check for. my-artifact
No repository The repository to check for the artifact in. myparcelnl/actions ${{ github.repository }}
No per-page The number of artifacts to fetch per page. 20 20
No max-age The maximum age of the artifact in hours. 24 24
Outputs
Name Description Example
id The ID of the artifact, if it exists. 1234
exists Whether the artifact exists in the repository. true

get-github-token

Source

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.

Example
- 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.
Inputs

This action uses the App inputs.

Outputs
Name Description Example
token The GitHub token. ***

pr-assign-author

Source

Assign the author of a pull request to the pull request. For use with the pull_request event.

Example
- 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 }}
Inputs

See App inputs

pr-label-by-review

Source

Label a pull request based on the review state. For use with the pull_request_review event.

  1. 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.
  1. Calculates whether the PR is approved or changes are requested.
  2. 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 and inputs.label-changes-requested are removed if they exist.
Example
- 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.
Inputs

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

pr-post-artifacts

Source

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.

Example
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 }}
Inputs
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 }}

pr-validate-title-conventional

Source

Validate the title of a pull request based on the conventional commit format. For use with the pull_request event.

Example
- 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 }}
Inputs

This action uses the App inputs.

Outputs
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)

rebase-prs

Source

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.
  • Sets ${{ github.repository_owner }}:* as a default value for the head input to ignore forks.
Inputs

This action uses the App inputs, as well as the inputs from the original action.

repository-dispatch

Source

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.
Inputs

This action uses the App inputs, as well as the inputs from the original action.

stale

Source

Mark issues and pull requests as stale after a period of inactivity. For use with the schedule event.

Example
- uses: myparcelnl/actions/stale@v4
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    days-before-stale: 30
    days-before-pr-stale: 30
Inputs

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)
Outputs
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-label

Source

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.

Example
- uses: myparcelnl/actions/toggle-label@v4
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    label: 'failing tests'
    toggle: ${{ steps.tests.outputs.failed }}
Inputs

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

update-comment

Source

Create or update a comment on an issue or pull request.

Example
- 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
Inputs

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
Outputs
Name Description Example
comment-id The ID of the comment that was created or updated 572389429

Nx

nx-cache

Source

Save and restore the Nx cache.

  1. Runs [actions/cache] and caches ./.nx/cache (default)

Inputs

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

nx-run

Source

Run nx run with the provided arguments.

  1. Runs [nx-cache]
  2. Runs <prefix> nx run <target> <args>.
Example
- uses: myparcelnl/actions/nx-run@v4
  with:
    target: 'my-project:build'
    prefix: 'yarn'
    cloud: true
    runner: 'cloud'
    args: '--exclude=some-project'
Inputs
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
No cloud Whether this will run using nx cloud true false
No command The command to run run-many run
No runner The runner to use cloud -

nx-run-many

Source

Run nx run-many with the provided arguments.

  1. Runs [nx-cache]
  2. Runs <prefix> nx run-many <args> --target=<target>.
Example
- uses: myparcelnl/actions/nx-run-many@v4
  with:
    target: 'build'
    prefix: 'yarn'
    cloud: true
    runner: 'cloud'
    args: '--exclude=some-project'
Inputs
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
No cloud Whether this will run using nx cloud true false
No command The command to run run-many run
No runner The runner to use cloud -
No parallel How many commands can run in parallel 1 -

Miscellaneous

bun-install

Setup Bun and install dependencies.

  1. Runs oven-sh/setup-bun
  2. Caches bun cache folder
  3. Installs dependencies with bun install <bun-args>
Example
- uses: myparcelnl/actions/bun-install@v4
  with:
    bun-version: 1.0.0
Inputs
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

bundlewatch

Source

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.

Example
- uses: myparcelnl/actions/bundlewatch@v4
  with:
    config: .bundlewatch.json
    token: ${{ secrets.BUNDLEWATCH_TOKEN }}
Inputs
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

Source

Create cache keys for use with [actions/cache].

Example
- 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)
Inputs
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
Outputs
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-

deprecated

Source

Mark something as deprecated. This will add a warning to the workflow run.

Example
- uses: myparcelnl/actions/deprecated@v4
  with:
    name: 'my-name/my-action'
    replacement: 'my-name/my-new-action'
    reason: 'It is no longer maintained.'
Inputs
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.

format-string

Source

Format a string. Input should be a string separated by the input-separator. If input string is empty, an empty string will be returned. Lines can be sorted and deduplicated. The string that is formatted will be output as string.

Example
- uses: myparcelnl/actions/format-string@v4
  id: format
  with:
    string: |
      no longer
      string
      a
      multiline
    input-separator: '\n'
    output-separator: ' '
    deduplicate: true
    sort: true

- run: echo ${{ steps.format.outputs.string }} // a multiline no longer string

Mode: args

- uses: myparcelnl/actions/format-string@v4
  id: format
  with:
    mode: 'args'
    string: |
      --arg2=value1
      --arg1
      --verbose
      --arg2=override
    input-separator: '\n'
    output-separator: ' '
    deduplicate: true
    sort: true

- run: echo ${{ steps.format.outputs.string }} // --arg1 --arg2=override --verbose
Inputs
Required Name Description Example Default
Yes string The string to format. Can be empty or multiple lines. my string
No input-separator The separator to use when splitting input to multiple lines. ' ' '\n'
No output-separator The separator to use for the generated output string. ',' ' '
No deduplicate Whether to deduplicate the lines before joining. Always done if mode is "args". true false
No sort Whether to sort the lines before joining. true false
No mode The mode to use for formatting. Set to "args" to deduplicate key-value pairs. args
Outputs
Name Description Example
string The formatted string. `my string to hash'

hash-string

Source

Hash a string. Input should be a string separated by the input-separator. If input string is empty, an empty string will be returned. If input string contains multiple lines (according to the separator) the lines will be sorted, deduplicated and hashed. The string that is hashed will be output as string.

Example
- uses: myparcelnl/actions/hash-string@v4
  id: hash
  with:
    method: 'sha256sum'
    separator: '\n' # default value
    string: |
      my
      multiline
      string

- run: echo ${{ steps.hash.outputs.string }} // multiline my string

- run: echo ${{ steps.hash.outputs.hash }} // bdfe7443bc0ddf3fb21a2c407e876458d04a5931b16259cbd727f7fd6ac4ef3b
Inputs
Required Name Description Example Default
Yes string The string to hash. Can be empty or multiple lines. my string
No separator The separator to use when splitting input to multiple lines. ' ' '\n'
No method The hashing method to use. sha256sum md5sum
No mode The mode to use for formatting. Set to "args" to deduplicate key-value pairs. args
Outputs
Name Description Example
hash The hashed string, empty if no string was provided. c403c22aac54783366d90df0bbdadc1a
string The string that was hashed. `my string to hash'

App inputs

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.

Inputs

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 }}