Skip to content

Commit

Permalink
Update 1pass.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Crushoverride007 committed Nov 22, 2023
1 parent 4c5cd23 commit f085196
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions .github/workflows/1pass.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
name: 1Password - Secret Scanning

name: Build and Test
on:
push:
branches:
- master
- 'master'
pull_request:
branches:
- 'master'

jobs:
build:
name: Build
build-and-test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Set up 1Password
uses: 1Password/connect-secure@v1
- name: Get secrets from 1Password
uses: 1Password/secrets@v1
with:
connect_token: ${{ secrets.OP_CONNECT_TOKEN }}
connect_host: ${{ secrets.OP_CONNECT_HOST }}

- name: Retrieve secret from 1Password
id: my_secret
subdomain: my
vault: 1Pass
secrets: |
MY_SECRET=Git1p
env:
OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }}

- name: Install dependencies
run: |
echo "OP_ITEM=my_secret" >> $GITHUB_ENV
shell: bash

- name: Build the project
run: |
echo "Here is where you'd put your build commands!"
pip install -r requirements.txt
# Add rest of your jobs such as 'test' and 'deploy'
- name: Run tests
run: |
export MY_SECRET="${{ secrets.MY_SECRET }}"
pytest

0 comments on commit f085196

Please sign in to comment.