Skip to content

Commit e9743a4

Browse files
committed
Update Readme
1 parent 1dc9da1 commit e9743a4

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,41 @@
1-
# github-action-template
1+
# Overwrite Env File
2+
3+
This GitHub Action allows you to overwrite the contents of an environment file with the contents of another file. It is useful when you want to promote/stage environment variables from one environment to another (for example, from a `.env.development` file to a `.env.production` file) automatically in your workflows.
4+
5+
## Usage
6+
7+
```yaml
8+
- name: Overwrite production env file with development env file
9+
uses: ./action-tools/overwrite-env-file
10+
with:
11+
input: .env.development
12+
output: .env.production
13+
```
14+
15+
#### Inputs
16+
17+
| Name | Description | Required | Default |
18+
|--------------|------------------------------|----------|---------------------|
19+
| input | The file to read from | true | .env.development |
20+
| output | The file to overwrite to | true | .env.production |
21+
22+
## Example Workflow
23+
24+
```yaml
25+
name: Promote env to production
26+
27+
on:
28+
push:
29+
branches: [main, dev]
30+
31+
jobs:
32+
promote-env:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Overwrite production env file with development env file
39+
uses: dev-five-git/overwrite-env-file-action@v1
40+
if: github.ref_name == 'dev'
41+
```

0 commit comments

Comments
 (0)