Add subaction to persist Connect details
This commit is contained in:
14
configure/action.yml
Normal file
14
configure/action.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
name: configure-action
|
||||
inputs:
|
||||
connect-host:
|
||||
description: Your 1Password Connect instance URL
|
||||
connect-token:
|
||||
description: Token to authenticate to your 1Password Connect instance
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- run: |
|
||||
export INPUT_CONNECT_HOST=${{ inputs.connect-host }}
|
||||
export INPUT_CONNECT_TOKEN=${{ inputs.connect-token }}
|
||||
${{ github.action_path }}/entrypoint.sh
|
||||
shell: bash
|
||||
15
configure/entrypoint.sh
Executable file
15
configure/entrypoint.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Capture Connect configuration in $GITHUB_ENV, giving (optional) inputs
|
||||
# precendence over OP_CONNECT_* environment variables.
|
||||
|
||||
OP_CONNECT_HOST=${INPUT_CONNECT_HOST:-$OP_CONNECT_HOST}
|
||||
if [ -n "$OP_CONNECT_HOST" ]; then
|
||||
echo "OP_CONNECT_HOST=$OP_CONNECT_HOST" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
OP_CONNECT_TOKEN=${INPUT_CONNECT_TOKEN:-$OP_CONNECT_TOKEN}
|
||||
if [ -n "$OP_CONNECT_TOKEN" ]; then
|
||||
echo "OP_CONNECT_TOKEN=$OP_CONNECT_TOKEN" >> $GITHUB_ENV
|
||||
fi
|
||||
Reference in New Issue
Block a user