Skip to content

core.getInput (and maybe other things) doesn't work in another action #1124

Description

@daleyjem

Please let me know if I'm just doing things wrong, but when actions/github-script is used within another action, things like core.getInput('some_input) don't return anything.

I have a test here to demonstrate: daleyjem/test-github-script#1

Workflow File

name: Test
on:
  pull_request:
    types: [opened, synchronize]

jobs:
  test:
    name: test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Test input
        uses: ./.github/actions/test-input

Action File

name: Test Input
description: Test input
inputs:
  my_input: 
    description: My input
    required: false
    default: 'foobar'

runs:
  using: 'composite'
  steps:
    - name: Log input val
      uses: actions/github-script@v6
      with:
        script: |
          console.log('my_input =', core.getInput('my_input'))
    - name: Log it the other way
      run: |
        echo ${{ inputs.my_input }}
      shell: bash

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    corequestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions