GitHub Action
Get the GitHub Action runs.using Version
This GitHub Action (written in composite run steps) allows you to leverage GitHub Actions to get the runs.using version from the Action metadata file. This is primarily used before using the setup-node action when testing GitHub Actions.
Create a workflow .yml
file in your .github/workflows
directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.
For more information on this input, see the Workflow syntax for GitHub Actions
action-file-path
: The action.yml file path. Optional. Default:action.yml
For more information on this output, see the Workflow syntax for GitHub Actions and the Context and expression syntax for GitHub Actions
version
: The runs.using version. For example,20
fornode20
- Your
action.yml
file must contain the version under theruns:using:
key. For example:
runs:
using: 'node20'
- Use the action's output as an input to setup-node action. For example:
on: push
name: Sample Workflow
jobs:
build:
name: Example
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get runs.using version
id: get-runs-using-version
uses: zgosalvez/github-actions-get-action-runs-using-version@v1
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.get-runs-using-version.outputs.version }}
This is used in the CI workflows of my GitHub Actions repositories, including this one.
The scripts and documentation in this project are released under the MIT License