Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 934655b

Browse filesBrowse files
Document how to use env: as input
1 parent a56d450 commit 934655b
Copy full SHA for 934655b

File tree

Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+22Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.