Giter Site home page Giter Site logo

github-actions-matrix-run-id's Introduction

github-actions-matrix-run-id

Fetches the current workflow run ID of a matrix job from the GitHub API

Pull Requests welcome!

Setup

Environment Variables

MATRIX_ID required

GH_TOKEN conditional PAT is required only for private repositories

Example Workflow

Matrix

jobs:
  Runs:
    strategy:
      matrix:
        example_run: [run_one, run_two]

Pass Matrix job ID to environment

    steps:   
      - name: Build
        run: npm run build
        env:
          MATRIX_ID: ${{ matrix.example_run }}
          GH_TOKEN: ${{ secrets.GH_TOKEN }}

Usage

Install

npm install 'HMKnapp/github-actions-matrix-run-id#master'

Use via CLI

Output: Numeric run ID

node ./node_modules/github-actions-matrix-run-id/index.js
> 1234567890

Optional: Add parameter --url to get full URL

node ./node_modules/github-actions-matrix-run-id/index.js --url
> https://github.com/HMKnapp/github-actions-matrix-run-id/runs/1234567890

Use as Module

Example

const { getRunID } = require("github-actions-matrix-run-id");

async function printID() {
  const id = await getRunID();
  console.log(id);
}

printID();

Known Limitations

Issues getting ID for Pull Request runs

github-actions-matrix-run-id's People

Contributors

hmknapp avatar

Watchers

 avatar

Forkers

amoskeyz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.