This is a safer approach since the main branch is protected. Therefore any chages to the reusable workflow will be intentional.
59 lines
2.0 KiB
YAML
59 lines
2.0 KiB
YAML
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
name: Run acceptance tests
|
|
|
|
jobs:
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
- run: npm ci
|
|
- run: npm test
|
|
test-with-output-secrets:
|
|
if: |
|
|
github.ref == 'refs/heads/main' ||
|
|
(
|
|
github.event_name == 'pull_request' &&
|
|
github.event.pull_request.head.repo.full_name == github.repository
|
|
)
|
|
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
|
|
secrets: inherit
|
|
with:
|
|
secret: op://acceptance-tests/test-secret/password
|
|
secret-in-section: op://acceptance-tests/test-secret/test-section/password
|
|
multiline-secret: op://acceptance-tests/multiline-secret/notesPlain
|
|
export-env: false
|
|
test-with-export-env:
|
|
if: |
|
|
github.ref == 'refs/heads/main' ||
|
|
(
|
|
github.event_name == 'pull_request' &&
|
|
github.event.pull_request.head.repo.full_name == github.repository
|
|
)
|
|
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
|
|
secrets: inherit
|
|
with:
|
|
secret: op://acceptance-tests/test-secret/password
|
|
secret-in-section: op://acceptance-tests/test-secret/test-section/password
|
|
multiline-secret: op://acceptance-tests/multiline-secret/notesPlain
|
|
export-env: true
|
|
test-references-with-ids:
|
|
if: |
|
|
github.ref == 'refs/heads/main' ||
|
|
(
|
|
github.event_name == 'pull_request' &&
|
|
github.event.pull_request.head.repo.full_name == github.repository
|
|
)
|
|
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
|
|
secrets: inherit
|
|
with:
|
|
secret: op://v5pz6venw4roosmkzdq2nhpv6u/hrgkzhrlvscomepxlgafb2m3ca/password
|
|
secret-in-section: op://v5pz6venw4roosmkzdq2nhpv6u/hrgkzhrlvscomepxlgafb2m3ca/Section_tco6nsqycj6jcbyx63h5isxcny/doxu3mhkozcznnk5vjrkpdqayy
|
|
multiline-secret: op://v5pz6venw4roosmkzdq2nhpv6u/ghtz3jvcc6dqmzc53d3r3eskge/notesPlain
|
|
export-env: false
|