Open whobutsb opened 1 year ago
I am currently stuck on this too. But using this script to unblock, I am not using this action and added a custom script.
- name: Install 1Password Cli
run: |
curl https://cache.agilebits.com/dist/1P/op2/pkg/v2.18.0/op_linux_amd64_v2.18.0.zip > op.zip
unzip op.zip
sudo mv op /usr/local/bin
rm op.zip
op user get --me
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- name: Get 1Password Secrets
run: op read op://api/dev/notesPlain > .env
working-directory: ./api
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
This works good
Same issue here working with Secure Notes to handle my .env
s.
@Rohithgilla12 your solution worked for me, thanks!
Same issue here, would be great if there was a way load-secrets-action
could handle this natively!
I am currently stuck on this too. But using this script to unblock, I am not using this action and added a custom script.
.........
This works good
Another solution using action 1password/install-cli-action:
- name: Install 1Password CLI
uses: 1password/install-cli-action@v1
with:
version: 2.18.0
- name: Get 1Password Secrets
run: op read op://api/dev/notesPlain > .env
working-directory: ./api
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
I am currently stuck on this too. But using this script to unblock, I am not using this action and added a custom script.
.........
This works good
Another solution using action 1password/install-cli-action:
- name: Install 1Password CLI uses: 1password/install-cli-action@v1 with: version: 2.18.0 - name: Get 1Password Secrets run: op read op://api/dev/notesPlain > .env working-directory: ./api env: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
Another solution using a .env.template
with references to your 1P Vaults secret reference path. And then using a environment variable, such as $TARGET_ENV
to toggle which vaults to get which environments secret from.
Using the op inject
from the 1password/install-cli-action
either as a basic run command, or via bash script that is passed arguments.
TARGET_ENV="dev" op inject -f -i ".env.template" -o ".env"
The initial .env.template
would contain the 1p secret reference paths:
JWKS_ISSUER=op://$TARGET_ENV/jwks/JWKS_ISSUER
JWKS_URI=op://$TARGET_ENV/jwks/JWKS_URI
NODE_ENV=op://$TARGET_ENV/common/node_env
# gRPC endpoints:
GRPC__HEALTH__V1__HEALTH_GRPC=op://$TARGET_ENV/grpc/health_grpc
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:When it gets to loading the
.env
file the contents of the file and error is message: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:
It would be great mimic the functionality of the Makefile command with this github action.
Thank you!