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

Unrecognized named-value: 'github' in defaults.run #81

Closed
phamnhuvu-dev opened this issue Aug 18, 2020 · 3 comments
Closed

Unrecognized named-value: 'github' in defaults.run #81

phamnhuvu-dev opened this issue Aug 18, 2020 · 3 comments

Comments

@phamnhuvu-dev
Copy link

phamnhuvu-dev commented Aug 18, 2020

I am using github runner to build app for Android, iOS and Web. We have multiple sharing code projects at the application layer, so we need to config working-directory.

If I using this hard code. The runner works well

defaults:
  run:
    working-directory: manabie_teacher

Then I update script to require input for flexible building, but It's not working.

name: Delivery
on:
  workflow_dispatch:
    inputs:
      flavor:
        description: 'Flavor'
        required: true
        default: 'staging'
      working-directory:
        description: 'Working Directory'
        required: true
        default: 'manabie_teacher'

defaults:
  run:
    working-directory: ${{ github.event.inputs.working-directory }}

jobs:
  delivery-android:
    runs-on: [self-hosted, macOS]
    steps:
      - run: echo "::set-env name=DART_HOME::$RUNNER_TOOL_CACHE/flutter/bin/cache/dart-sdk/bin"
      - run: echo "::set-env name=FLUTTER_HOME::$RUNNER_TOOL_CACHE/flutter/bin"
      - run: echo "::set-env name=ANDROID_HOME::$RUNNER_TOOL_CACHE/sdk"
      - run: echo "::add-path::$DART_HOME"
      - run: echo "::add-path::$FLUTTER_HOME"
      - run: echo "::add-path::$ANDROID_HOME"
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.ref }}

      - uses: actions/setup-java@v1
        with:
          java-version: '12.x'

      - run: flutter pub get

      - name: Build Staging
        if : ${{ github.event.inputs.flavor == 'staging' }}
        run: make build-staging-android
      - name: Push Staging
        if : ${{ github.event.inputs.flavor == 'staging' }}
        run: make push-android token=${{ secrets.FIREBASE_TOKEN }}

      - name: Build Production
        if: ${{ github.event.inputs.flavor == 'production' }}
        run: make build-production-android
      - name: Push Production
        if: ${{ github.event.inputs.flavor == 'production' }}
        run: make push-prod-android token=${{ secrets.FIREBASE_TOKEN }}

Error:

The workflow is not valid. .github/workflows/delivery.yml (Line: 16, Col: 24): Unrecognized named-value: 'github'. Located at position 1 within expression: github.event.inputs.working-directory
@jclem
Copy link
Contributor

jclem commented Aug 18, 2020

@phamnhuvu-dev This doesn't look like it's part of a valid workflow file, or like it's directly related to this action. Could you supply a little more context, describing:

  • What the workflow is attempting to do
  • Where in the workflow this configuration is
  • How you're attempting to use actions/github-script

That would all help me sort this out for you! Thanks.

@phamnhuvu-dev
Copy link
Author

@jclem I updated description, thank you

@jclem
Copy link
Contributor

jclem commented Sep 1, 2020

I think you'll want to open this issue in https://github.community/c/github-actions. This repository you've opened an issue in isn't for GitHub Actions support generally, it's just one action that you're not using in this workflow file.

@jclem jclem closed this as completed Sep 1, 2020
This issue was closed.
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

No branches or pull requests

2 participants