Document how to use env: as input

This commit is contained in:
Nihal Gonsalves
2021-03-30 02:23:20 +05:30
parent a56d4504de
commit 934655b9e0

View File

@@ -294,3 +294,25 @@ jobs:
console.log(stdout) console.log(stdout)
``` ```
### Use env as input
You can set env vars to use them in your script:
```yaml
on: push
jobs:
echo-input:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
env:
FIRST_NAME: Mona
LAST_NAME: Octocat
with:
script: |
const { FIRST_NAME, LAST_NAME } = process.env
console.log(`Hello ${FIRST_NAME} ${LAST_NAME}`)
```