Skip to content

zgosalvez/github-actions-get-action-runs-using-version

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

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.

Usage

Pre-requisites

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.

Inputs

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

Outputs

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 for node20

Common workflow

  1. Your action.yml file must contain the version under the runs:using: key. For example:
runs:
  using: 'node20'
  1. 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 }}

GitHub Action Workflows

This is used in the CI workflows of my GitHub Actions repositories, including this one.

License

The scripts and documentation in this project are released under the MIT License

About

Get the GitHub Action runs.using version from the Action metadata file

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published