For the complete documentation index, see llms.txt. This page is also available as Markdown.

Reusable Actions

Reusable GitHub Actions for building custom sfops workflows

Reusable actions are building blocks provided by sfops that you can use to create custom workflows. These composite actions encapsulate common functionality and can be used in any workflow within your sfops repository.

Available Actions

Token & Authentication Actions

  • Get GitHub Token - Fetch GitHub tokens from sfp server for repository operations without configuring GitHub Apps

  • Hybrid Environment Authentication - Intelligent authentication that automatically uses SFP server or native SFDX authentication based on environment registration

  • Hybrid DevHub Authentication - Flexible DevHub authentication with automatic fallback between SFP server and native methods

  • Authentication with Lock - Secure authentication with exclusive environment locking for critical operations

  • Authentication without Lock - Streamlined authentication for read-only operations and concurrent access

Environment Discovery Actions

  • Fetch All Environments - Dynamically fetch and filter environments from GitHub Environments or sfp server for matrix builds and multi-environment workflows

  • Match Pool - Match pool assignment rules based on branch and domain patterns for intelligent environment selection

Change Detection Actions

PR Interaction Actions

  • Add PR Comment - Add, update, and manage PR comments with support for templating, status-based messages, and comment deduplication

Other Actions

sfops includes many other reusable actions for various purposes. You can find them in the /actions directory of your sfops repository:

  • manageEnvDeploymentLabel - Manage environment deployment labels on PRs

  • findCurrentPr - Find the current pull request context

  • get-github-token - Get GitHub App token for authentication

  • unlockEnvironment - Release environment locks

  • updateGitRepo - Update dashboard repository with workflow results

  • And many more...

Using Reusable Actions

All reusable actions in sfops are located in your sfops repository's actions directory. To use them in your custom workflow, reference them using the sfops template variables:

The ${{ sfops.repo_owner }}/${{ sfops.action_repository }} template variables automatically resolve to your organization and sfops repository (e.g., your-org/sfops-gh-actions).

Creating Custom Workflows

Reusable actions allow you to build sophisticated custom workflows by combining multiple actions. Common use cases include:

  • Data operations - Export/import data between environments

  • Maintenance automation - Scheduled tasks and cleanup operations

  • Multi-environment operations - Parallel operations across environments

Last updated

Was this helpful?