Skip to content

DOCSP-46221: Atlas SDK for Go Monitoring & Logging scripts for Atlas Architecture Center #6

DOCSP-46221: Atlas SDK for Go Monitoring & Logging scripts for Atlas Architecture Center

DOCSP-46221: Atlas SDK for Go Monitoring & Logging scripts for Atlas Architecture Center #6

name: Test JavaScript Code Examples against Atlas
on:
pull_request_target:
types: [opened, synchronize]
paths:
- "javascript/examples/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check access
if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' }}
run: |
echo "Event not triggered by a collaborator."
exit 1
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: |
cd javascript/
npm install
- name: Create environment file with connection string
run: |
cd javascript/
touch .env
echo "ATLAS_CONNECTION_STRING=\"${{secrets.JAVASCRIPT_CONNECTION_STRING}}\"" >> .env
echo "ENV=\"Atlas\"" >> .env
- name: Run tests
run: |
cd javascript/
npm test