mirror of
https://github.com/actions/container-action.git
synced 2025-06-15 01:37:42 +00:00
Correct input name
This commit is contained in:
parent
137e75c6a6
commit
e3750df619
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -45,10 +45,10 @@ jobs:
|
||||
- name: Run the Container
|
||||
id: run
|
||||
env:
|
||||
INPUT_WHO_TO_GREET: Mona Lisa Octocat
|
||||
INPUT_WHO-TO-GREET: Mona Lisa Octocat
|
||||
run: |
|
||||
docker run \
|
||||
--env INPUT_WHO_TO_GREET="Mona Lisa Octocat" \
|
||||
--env INPUT_WHO-TO-GREET="Mona Lisa Octocat" \
|
||||
--rm ${{ env.TEST_TAG }}
|
||||
|
||||
test-action:
|
||||
|
10
README.md
10
README.md
@ -54,7 +54,7 @@ need to perform some initial setup steps before you can develop your action.
|
||||
You can pass individual environment variables using the `--env` or `-e` flag.
|
||||
|
||||
```bash
|
||||
$ docker run --env INPUT_WHO_TO_GREET="Mona Lisa Octocat" actions/container-action
|
||||
$ docker run --env INPUT_WHO-TO-GREET="Mona Lisa Octocat" actions/container-action
|
||||
|
||||
::notice file=entrypoint.sh,line=7::Hello, Mona Lisa Octocat!
|
||||
```
|
||||
@ -63,7 +63,7 @@ need to perform some initial setup steps before you can develop your action.
|
||||
|
||||
```bash
|
||||
$ cat ./.env.test
|
||||
INPUT_WHO_TO_GREET="Mona Lisa Octocat"
|
||||
INPUT_WHO-TO-GREET="Mona Lisa Octocat"
|
||||
|
||||
$ docker run --env-file ./.env.test actions/container-action
|
||||
|
||||
@ -90,10 +90,10 @@ container actions:
|
||||
- Inputs are accessed using environment variables with the format
|
||||
`INPUT_<INPUT_NAME>`. For example, this action has an input called
|
||||
`who-to-greet`, which can be accessed in the entrypoint script using
|
||||
`INPUT_WHO_TO_GREET`.
|
||||
`INPUT_WHO-TO-GREET`.
|
||||
|
||||
```bash
|
||||
GREETING="Hello, $INPUT_WHO_TO_GREET!"
|
||||
GREETING="Hello, $INPUT_WHO-TO-GREET!"
|
||||
```
|
||||
|
||||
- GitHub Actions supports a number of different workflow commands such as
|
||||
@ -140,7 +140,7 @@ So, what are you waiting for? Go ahead and start customizing your action!
|
||||
|
||||
```bash
|
||||
docker build -t actions/container-action .
|
||||
docker run --env INPUT_WHO_TO_GREET="Mona Lisa Octocat" actions/container-action
|
||||
docker run --env INPUT_WHO-TO-GREET="Mona Lisa Octocat" actions/container-action
|
||||
```
|
||||
|
||||
1. Commit your changes
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh -l
|
||||
|
||||
# Use INPUT_<INPUT_NAME> to get the value of an input
|
||||
GREETING="Hello, $INPUT_WHO_TO_GREET!"
|
||||
GREETING="Hello, $INPUT_WHO-TO-GREET!"
|
||||
|
||||
# Use workflow commands to do things like set debug messages
|
||||
echo "::notice file=entrypoint.sh,line=7::$GREETING"
|
||||
|
Loading…
x
Reference in New Issue
Block a user