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

Cannot pass dynamic environment from input #3307

Open
lamhktommy opened this issue May 29, 2024 · 0 comments
Open

Cannot pass dynamic environment from input #3307

lamhktommy opened this issue May 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lamhktommy
Copy link

lamhktommy commented May 29, 2024

Describe the bug
Reusable workflow cannot get inputs passed from a main workflow

To Reproduce
Steps to reproduce the behavior:

dev/action.yml

name: Reusable workflow
on:
  workflow_dispatch:
    inputs:
      source-environment:
        required: true
        type: string
  workflow_call:
    inputs:
      source-environment:
        required: true
        type: string
jobs:
  build-and-push:
    name: Build and Push
    runs-on: ubuntu-latest
    environment: 
      name: ${{ inputs.source-environment }}
    secrets: inherit
    steps:
      - run: echo "${{ inputs.source-environment }}"
        shell: bash

main_workflow.yml

jobs:
  action-dev:
    if: github.ref == 'refs/heads/main'
    environment: develop
    name: Deploy to Dev
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Reuse action
        uses: ./.github/actions/dev
        with:
          source-environment: develop

I have tried to use github.event.inputs.source-environment as well and also doesn't work

Expected behavior
Expect develop is output in the console

Runner Version and Platform

ubuntu-latest

What's not working?

Unrecognized named-value: 'inputs'
image

@lamhktommy lamhktommy added the bug Something isn't working label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant