Skip to content

Commit

Permalink
Add 1password env to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
snoe committed Dec 6, 2024
1 parent 17a6dcc commit d8789d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/callable-partner-driver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on:
DOCKER:
type: boolean
required: true
secrets:
OP_SERVICE_ACCOUNT_TOKEN:
required: true

jobs:
run-tests:
Expand Down Expand Up @@ -65,6 +68,8 @@ jobs:
curl -O https://download.clojure.org/install/linux-install-1.11.1.1262.sh &&
sudo bash ./linux-install-1.11.1.1262.sh
- uses: 1password/install-cli-action@v1

- name: Setup Node
uses: actions/setup-node@v2
with:
Expand All @@ -87,7 +92,12 @@ jobs:
if: ${{ inputs.DOCKER }}
run: |
sudo echo "127.0.0.1 ${{ inputs.DRIVER }}" | sudo tee -a /etc/hosts
echo "MB_${{inputs.DRIVER}}_TEST_HOST=${{ inputs.DRIVER }}" >> "$GITHUB_ENV"
- name: Setup env from 1password
run: |
export DRIVER=${{ inputs.DRIVER }}
export OP_SERVICE_ACCOUNT_TOKEN=${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
op item list --format=json --tags partner-testing | jq -r ".[] | select(.title | test(\"driver: $DRIVER\")) | .id" | xargs -I {} op item get {} --format=json --vault "Driver Development" | jq -r ".fields[] | select(.section.label == \"ENV\") | \"MB_$(echo $DRIVER | tr '[:lower:]' '[:upper:]' | tr '-' '_')_TEST_\\(.label)=\\\"\\(.value)\\\"\"" >> $GITHUB_ENV
- name: Run tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-partner-driver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ jobs:
DRIVER: ${{ matrix.driver.name }}
REPO: ${{ matrix.driver.repo }}
DOCKER: ${{ matrix.driver.docker }}
secrets: inherit

0 comments on commit d8789d4

Please sign in to comment.