actionforge / graph-runner

πŸƒβ€β™€οΈ The core cli of Actionforge
Other
12 stars 0 forks source link

Evaluate context variables for github #22

Closed sebastianrath closed 6 months ago

sebastianrath commented 6 months ago

This PR fixes an issue reported in https://github.com/actionforge/action/issues/7 where contexts for inputs and matrix could not be accessed. The following node inputs evaluate these context variables:

  1. Env Array
  2. GitHub Actions
  3. Run (in the environment variables)

First pass the input and matrix to their respective action inputs.

[...]
      - name: Execute Action Graph
        uses: actionforge/action@v0.9.52
            inputs: ${{ toJson(inputs) }} πŸ‘ˆ
            matrix: ${{ toJson(matrix) }} πŸ‘ˆ

Inputs

on:
  workflow_dispatch:
    inputs:
      foo:
        description: 'Some value'
        required: true

There are two ways to access input values: Access 1: ${{ inputs.foo }} Access 2: ${{ github.event.inputs.foo }}

  deploy:
    strategy:
      matrix:
        include:
          - image: "api_internal_development"
            environment: "Internal/Development"
          - image: "api_internal_staging"
            environment: "Internal/Staging" 
          - image: "api_internal_production"
            environment: "Internal/Production"

Access 1: ${{ matrix.include }}