Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 934655b

Browse files
Document how to use env: as input
1 parent a56d450 commit 934655b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,25 @@ jobs:
294294

295295
console.log(stdout)
296296
```
297+
298+
### Use env as input
299+
300+
You can set env vars to use them in your script:
301+
302+
```yaml
303+
on: push
304+
305+
jobs:
306+
echo-input:
307+
runs-on: ubuntu-latest
308+
steps:
309+
- uses: actions/github-script@v3
310+
env:
311+
FIRST_NAME: Mona
312+
LAST_NAME: Octocat
313+
with:
314+
script: |
315+
const { FIRST_NAME, LAST_NAME } = process.env
316+
317+
console.log(`Hello ${FIRST_NAME} ${LAST_NAME}`)
318+
```

0 commit comments

Comments
 (0)