mirror of
https://github.com/tschoffelen/gha.git
synced 2024-09-11 21:37:16 +03:00
Added info about the differences with GitHub, and allow passing through GITHUB_TOKEN
This commit is contained in:
parent
49642105e8
commit
75af7eb53b
14
README.md
14
README.md
@ -30,7 +30,7 @@ Options:
|
|||||||
-h, --help output usage information
|
-h, --help output usage information
|
||||||
```
|
```
|
||||||
|
|
||||||
### Passing secrets
|
### Supplying values for secrets
|
||||||
|
|
||||||
You can set the value of [secrets](https://developer.github.com/actions/creating-workflows/storing-secrets/) defined in your workflow by passing them as environment variables, e.g.:
|
You can set the value of [secrets](https://developer.github.com/actions/creating-workflows/storing-secrets/) defined in your workflow by passing them as environment variables, e.g.:
|
||||||
|
|
||||||
@ -38,6 +38,14 @@ You can set the value of [secrets](https://developer.github.com/actions/creating
|
|||||||
MY_SECRET_TOKEN=yo-mamma gha
|
MY_SECRET_TOKEN=yo-mamma gha
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Differences with GitHub Actions
|
||||||
|
|
||||||
|
Although this way of locally running GitHub Actions is very close to how they
|
||||||
|
will work when actually running them on GitHub, there are a few small differences:
|
||||||
|
|
||||||
|
* In the GitHub environment, the `GITHUB_TOKEN` is passed to all actions by default. This is not the case in the local environment, but can be achieved by creating a [personal token](https://github.com/settings/tokens/new?scopes=repo&description=GHA) and supplying it as a secret (see above).
|
||||||
|
* The `/github/home` volume in the container is tied to your local directory `/tmp/gh-home`. In GitHub, this directory is container-specific, whereas this script shares it between all containers.
|
||||||
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
@ -50,7 +58,3 @@ to add:
|
|||||||
- [ ] Add support for local Docker images: [`./path/to/dir`](https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#using-a-dockerfile-image-in-an-action)
|
- [ ] Add support for local Docker images: [`./path/to/dir`](https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#using-a-dockerfile-image-in-an-action)
|
||||||
- [ ] Add support for Docker Hub images: [`docker://{image}:{tag}`](https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#using-a-dockerfile-image-in-an-action)
|
- [ ] Add support for Docker Hub images: [`docker://{image}:{tag}`](https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#using-a-dockerfile-image-in-an-action)
|
||||||
- [ ] Add support for custom hosted Docker images: [`docker://{host}/{image}:{tag}`](https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#using-a-dockerfile-image-in-an-action)
|
- [ ] Add support for custom hosted Docker images: [`docker://{host}/{image}:{tag}`](https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#using-a-dockerfile-image-in-an-action)
|
||||||
|
|
||||||
Some improvements are also possible in other areas:
|
|
||||||
|
|
||||||
- [ ] Add support for default [`GITHUB_TOKEN`](https://developer.github.com/actions/creating-workflows/storing-secrets/#github-token-secret) env var
|
|
||||||
|
@ -130,6 +130,10 @@ const runAction = (actionTitle, actions, event, verbose) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('GITHUB_TOKEN' in process.env && !('GITHUB_TOKEN' in action.env)) {
|
||||||
|
action.env.GITHUB_TOKEN = process.env.GITHUB_TOKEN
|
||||||
|
}
|
||||||
|
|
||||||
const uses = action.uses
|
const uses = action.uses
|
||||||
const imageName = resolveRunner(uses, verbose)
|
const imageName = resolveRunner(uses, verbose)
|
||||||
let args = []
|
let args = []
|
||||||
|
Loading…
Reference in New Issue
Block a user