-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Hello All,
I'm trying to deploy a Laravel application with a environment file saved in our 1Password vault as a secure note. In our github action we would like to use the latest copy of the environment file and add the contents to a .env during the deployment process. This is how we are currently doing it:
- name: Configure 1Password Connect
uses: 1password/load-secrets-action/configure@v1
with:
# Persist the 1Password Service Account token. This will grant
# all steps of the job access to the token.
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# Get ENV content from 1Password
- name: Load secret
id: op-load-secret
uses: 1password/[email protected]
with:
export-env: true
env:
APP_ENV: "op://MyProject/Staging Environment/notesPlain"
# Create ENV file
- name: Copy the secret to .env
run: 'echo $APP_ENV > .env'
When it gets to loading the .env file the contents of the file and error is message:
The environment file is invalid!
Failed to parse dotenv file. Encountered unexpected whitespace at ["Laravel Application" *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***].
Is there any way to unmask the contents?
In our local development process we have setup a Makefile command to help with downloading the latest environment file:
env-staging:
op read op://$(ACCOUNT_NAME)/$(ENV_STAGING)/notesPlain -o .env.staging
cp .env.staging .env
It would be great mimic the functionality of the Makefile command with this github action.
Thank you!
oleg-smartone and jamesarosenRohithgilla12
Metadata
Metadata
Assignees
Labels
No labels