Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate context variables for github #22

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

sebastianrath
Copy link
Member

@sebastianrath sebastianrath commented Mar 1, 2024

This PR fixes an issue reported in actionforge/action#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 }}

@sebastianrath sebastianrath merged commit 00e8e9c into main Mar 1, 2024
1 check passed
@sebastianrath sebastianrath deleted the feature-inputs-and-matrix branch March 1, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant