feat: add multiline string support #77
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build and test" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
PRODUCTION: true | |
ENV_KEY_PROJECT_NAME: dot-env | |
jobs: | |
build: | |
name: Build package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
check-latest: true | |
- run: | | |
corepack enable | |
- name: Install dependencies | |
run: | | |
pnpm install | |
- name: Build and package action | |
run: | | |
pnpm run format-check && pnpm run build && pnpm run package | |
- name: Verify is there is no diff | |
run: | | |
if [[ -n $(git diff --exit-code) ]] | |
then | |
echo "Please run `pnpm run build && pnpm run package` to update dist folder" | |
exit | |
fi | |
test: | |
name: Test env file | |
needs: build | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
ENV_KEY_DEBUG: true | |
ENV_KEY_USERNAME: root | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
check-latest: true | |
- run: | | |
corepack enable | |
- id: test-action | |
uses: ./ | |
with: | |
input-prefix: "ENV_KEY_" | |
file-path: "tests/development.env" | |
output-prefix: "OUTPUT_" | |
env: | |
IS_SERVER: false | |
ENV_KEY_USERNAME: admin | |
ENV_KEY_API_KEY: USER_API_KEY | |
ENV_KEY_SECRET_KEY: secret123 | |
ENV_KEY_ENV_KEY_MULTIPLE: test | |
SOME_ENV_KEY: no_value | |
ENV_KEY_MULTILINE: | | |
some multiline | |
string here | |
- name: Cat generated dot env file | |
run: | | |
cat tests/development.env | |
- name: Install pnpm dependencies | |
run: | | |
pnpm install | |
- name: Run test | |
run: | | |
pnpm run test |