Skip to main content
deleted 22 characters in body
Source Link

If some one else is searching for a solution:

You you have to explicityexplicitly pass the environment variables to the bash script. Otherwise they are not available.:

name: x-pull-request
on: pull_request
env:
  FOO: bar
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: does a thing
        run: ./scripts/do-a-thing.sh $FOO

Andand in the Scriptscript you have to map the parameter to a variable.

X=$1
echo "X: $X" # X: default

Hope this helps.

If some one else is searching for a solution:

You have to explicity pass the environment variables to the bash script. Otherwise they are not available.

name: x-pull-request
on: pull_request
env:
  FOO: bar
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: does a thing
        run: ./scripts/do-a-thing.sh $FOO

And in the Script you have to map the parameter to a variable.

X=$1
echo "X: $X" # X: default

Hope this helps.

If some one else is searching for a solution you have to explicitly pass the environment variables to the bash script. Otherwise they are not available:

name: x-pull-request
on: pull_request
env:
  FOO: bar
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: does a thing
        run: ./scripts/do-a-thing.sh $FOO

and in the script you have to map the parameter to a variable.

X=$1
echo "X: $X" # X: default
Source Link
Mehtrick
  • 526
  • 3
  • 12

If some one else is searching for a solution:

You have to explicity pass the environment variables to the bash script. Otherwise they are not available.

name: x-pull-request
on: pull_request
env:
  FOO: bar
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: does a thing
        run: ./scripts/do-a-thing.sh $FOO

And in the Script you have to map the parameter to a variable.

X=$1
echo "X: $X" # X: default

Hope this helps.