Closed danilobjr closed 1 year ago
Hey to help out, can you give me an outline of your project directory structure?
I think I have an idea of the issue, but I want to confirm before I make any changes to the action script.
Right now, my immediate inclination is that the project being run, contains multiple package.json files, and the .env file is placed in the directory level that is found first. However, I want to see how your project directory structure is, to see if it's something else :) !
@aasmal97 thanks for the rapid response!
It's a regular create-react-app
application (using craco
on top of that).
drwxr-xr-x 30 danilo staff 960 Apr 18 15:26 .
drwxr-xr-x 7 danilo staff 224 Mar 31 03:01 ..
-rw-r--r--@ 1 danilo staff 8196 Apr 18 15:16 .DS_Store
-rw-r--r-- 1 danilo staff 201 Apr 5 07:36 .editorconfig
-rw-r--r-- 1 danilo staff 18 Apr 5 07:36 .env.example
-rw-r--r-- 1 danilo staff 88 Apr 18 15:23 .env.local
drwxr-xr-x 18 danilo staff 576 Apr 18 15:20 .git
drwxr-xr-x 3 danilo staff 96 Apr 5 20:04 .github
-rw-r--r-- 1 danilo staff 318 Apr 5 20:04 .gitignore
drwxr-xr-x 4 danilo staff 128 Apr 5 07:36 .husky
-rw-r--r-- 1 danilo staff 117 Apr 5 07:36 .lintstagedrc
-rw-r--r-- 1 danilo staff 56 Apr 5 07:36 .prettierignore
-rw-r--r-- 1 danilo staff 362 Apr 5 07:36 .prettierrc
drwxr-xr-x 4 danilo staff 128 Apr 6 21:12 .vercel
drwxr-xr-x 3 danilo staff 96 Apr 18 12:51 .vscode
-rw-r--r-- 1 danilo staff 2117 Apr 5 07:36 README.md
drwxr-xr-x 10 danilo staff 320 Apr 18 13:23 build
-rw-r--r-- 1 danilo staff 268 Apr 18 12:51 craco.config.js
-rw-r--r-- 1 danilo staff 752 Apr 17 22:54 meeting.md
drwxr-xr-x 889 danilo staff 28448 Apr 18 13:08 node_modules
-rw-r--r-- 1 danilo staff 643226 Apr 18 12:51 package-lock.json
-rw-r--r-- 1 danilo staff 1542 Apr 18 12:51 package.json
-rw-r--r-- 1 danilo staff 28936 Apr 5 07:36 products.json
drwxr-xr-x 9 danilo staff 288 Apr 18 15:20 public
drwxr-xr-x 15 danilo staff 480 Apr 18 13:34 src
-rw-r--r-- 1 danilo staff 1390 Apr 18 12:51 tailwind.config.js
-rw-r--r-- 1 danilo staff 84 Apr 18 15:26 test.md
-rw-r--r-- 1 danilo staff 541 Apr 5 07:36 tsconfig.json
-rw-r--r-- 1 danilo staff 320 Apr 5 07:36 tsconfig.paths.json
-rw-r--r-- 1 danilo staff 147 Apr 18 15:20 vercel.json
If you need something more, just tell me.
Something came to my mind. If I may suggest it...
What about to include an input like working-directory
? With that you could set manually where you want to place the .env
file. It'll be a controlled situation and the developer will always know the folder destination.
What do you think?
- name: Generate .env file
uses: aasmal97/create-react-app-env@1.1.0
with:
working-directory: ./
REACT_APP_SECRETS: ${{toJson(secrets)}}
That sounds like a good idea :) ! I'm going to work on adding that feature but I also realized in my most recent project, the auto-detecting of the package.json location is behaving weirdly. I'm going to work on a fix for that and hopefully have it ready by the end of this week. @danilobjr
This issue has been resolved :) ! In addition, there is support for multiple new inputs including a destination path
Hello,
I'm trying to use this action but having some issues with it. Can you help me with it?
Description
After the
.env
file creation, it's moved to root folder. This root folder should be the same folder of mypackage.json
file, but I'm already running this action in my project root folder. So I tried tols -la
to see if.env
file was created, but I couldn't see it.Screenshots
Workflow