Skip to content

Commit 8b294d5

Browse files
authored
Merge pull request #17 from SpicyPizza/prepare-1.1-release
Prepare for 1.1
2 parents b2cbcd0 + 8cfea13 commit 8b294d5

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Forest Anderson
3+
Copyright (c) 2021 Forest Anderson
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
# Create Envfile Github Action
22

3-
**Name: SpicyPizza/create-envfile@v1**
3+
[![GitHub
4+
release](https://img.shields.io/github/release/SpicyPizza/create-envfile.svg?style=flat-square)](https://github.com/SpicyPizza/create-envfile/releases/latest)
5+
[![GitHub
6+
marketplace](https://img.shields.io/badge/marketplace-create--env--file-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/create-env-file)
7+
[![Licence](https://img.shields.io/github/license/SpicyPizza/create-envfile)](https://github.com/SpicyPizza/create-envfile/blob/master/LICENSE)
48

5-
Github Action to create a .env file with Github Secrets
9+
### SpicyPizza/[email protected]
10+
11+
## About
12+
13+
A Github Action to create a .env file with Github Secrets. This is useful when
14+
you are creating artifacts that need to contain secrets stored in Github
15+
Secrets. This creates a file with variables that are defined in the Action
16+
config.
617

718
## Usage
819

9-
The action looks for environment variables that start with `INPUT_ENVKEY_` and creates an envfile with them. To add a key to the envfile, add a key/pair to the `with:` section. It must begin with `envkey_`.
20+
The Action looks for environment variables that start with `envkey_` and creates
21+
an envfile with them. These are defined in the `with` section of the Action
22+
config. Here is an example of it in use:
1023

1124
```yml
1225
name: Create envfile
@@ -31,14 +44,34 @@ jobs:
3144
file_name: .env
3245
```
3346
34-
In this example, there are 6 keys:
47+
## Inputs
48+
49+
In the example above, there are several key/value pairs that will be added to
50+
the envfile:
51+
52+
| Name | Description |
53+
|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
54+
| `envkey_DEBUG`, `envkey_SOME_API_KEY` | These values can be whatever, and they will be added to the envfile as `DEBUG` and `SOME_API_KEY` . |
55+
| `envkey_SOME_API_KEY` | This one will use a secret stored in the repository's Github Secrets, and add it to the file as `SECRET_KEY` |
56+
| `directory` (**Optional**) | This key will set the directory in which you want to create `env` file. (Action will fail if the specified directory doesn't exist.) |
57+
| `file_name` (**Optional**) | Set the name of the output envfile. Defaults to `.env` |
3558

36-
`envkey_DEBUG`, `envkey_SOME_API_KEY` - String values
59+
Assuming that the Github Secret that was used is `password123`, the .env file
60+
that is created from the config above would contain:
61+
62+
```
63+
DEBUG: false
64+
SOME_API_KEY: "123456abcdef"
65+
SECRET_KEY: password123
66+
```
3767

38-
`envkey_SECRET_KEY` - A secret stored in the repository's Github Secrets
68+
## Potential Issues
3969

40-
`some_other_variable` - Won't be used because it doesn't start with `envkey_`
70+
### Warnings
4171

42-
`directory`(**Optional**) - This key will set the directory in which you want to create `env` file. (**Action will fail if the specified directory doesn't exist.**)
72+
When the Action runs, it will show `Warning: Unexpected input(s) ...`. This is
73+
because Github is expecing all the potential input variables to be defined by
74+
the Action's definition. You can read more about it in [this
75+
issue](https://github.com/SpicyPizza/create-envfile/issues/10).
4376

44-
`file_name`(**Optional**) - Set the name of the output envfile. Defaults to `.env`
77+
![](https://user-images.githubusercontent.com/12802646/106284483-594e2300-6254-11eb-9e5d-3a6426da0435.png)

0 commit comments

Comments
 (0)