Authenticate to an Environment without Lock (SFP Server)
Learn how to authenticate to Salesforce environments through SFP server without locking for read-only operations and concurrent access scenarios
Last updated
Was this helpful?
Was this helpful?
jobs:
your-job:
runs-on: ubuntu-latest
container: ${{ sfops.sfops_docker_image }}uses: ${{ sfops.repo_owner }}/${{ sfops.action_repository }}/authToEnvironmentWithoutLock@mainname: Query Environment Data
on:
workflow_dispatch:
inputs:
environment:
description: 'Target environment'
required: true
type: string
jobs:
query-data:
runs-on: ubuntu-latest
container: ${{ sfops.sfops_docker_image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Authenticate Without Lock
id: auth
uses: ${{ sfops.repo_owner }}/${{ sfops.action_repository }}/authToEnvironmentWithoutLock@main
with:
environment: ${{ inputs.environment }}
repository: ${{ github.repository }}
sfp-server-url: ${{ vars.SFP_SERVER_URL }}
sfp-server-token: ${{ secrets.SFP_SERVER_TOKEN }}
- name: Query Data
run: |
# Safe to run concurrently - read-only operation
sfdx force:data:soql:query \
--targetusername ${{ steps.auth.outputs.alias }} \
--query "SELECT COUNT() FROM Account" \
--jsonname: Multi-Environment Health Check
on:
schedule:
- cron: '0 */6 * * *' # Every 6 hours
jobs:
check-environment:
runs-on: ubuntu-latest
container: ${{ sfops.sfops_docker_image }}
strategy:
matrix:
environment: [dev, staging, uat, production]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Authenticate Without Lock
id: auth
uses: ${{ sfops.repo_owner }}/${{ sfops.action_repository }}/authToEnvironmentWithoutLock@main
with:
environment: ${{ matrix.environment }}
repository: ${{ github.repository }}
sfp-server-url: ${{ vars.SFP_SERVER_URL }}
sfp-server-token: ${{ secrets.SFP_SERVER_TOKEN }}
- name: Check Environment Health
run: |
# Multiple jobs can check different environments simultaneously
sfdx force:limits:api:display \
--targetusername ${{ steps.auth.outputs.alias }} \
--json
- name: Check Apex Test Coverage
run: |
sfdx force:apex:test:report \
--targetusername ${{ steps.auth.outputs.alias }} \
--codecoverage \
--json