The Pull Power Platform Changes action exports a Power Platform solution from a target environment, unpacks it, and commits the changes back to your Git repository. This enables version control and collaboration for Power Platform solutions.
Usage
- uses: microsoft/AL-Go/Actions/[email protected]
with:
environmentName: 'Development'
solutionFolder: 'MySolution'
deploymentEnvironmentsJson: ${{ secrets.DEPLOYMENT_ENVIRONMENTS }}
shell
string
default:"powershell"
Shell in which you want to run the action (powershell or pwsh)
actor
string
default:"${{ github.actor }}"
The GitHub actor running the action
token
string
default:"${{ github.token }}"
The GitHub token running the action
Name of environment to pull changes fromThis should match a Power Platform environment configured in your deployment settings.
Name of the solution to download and folder in which to download the solutionThis is both the Power Platform solution name and the target folder in your repository.
deploymentEnvironmentsJson
The settings for all Deployment Environments in compressed JSON formatContains authentication credentials and environment URLs for Power Platform.
updateBranch
string
default:"${{ github.ref_name }}"
Set the branch to updateChanges will be committed to this branch.
Direct Commit?When true, changes are committed directly to the branch. When false, a pull request is created.
Example Workflows
Basic Pull Changes
jobs:
pull-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Pull Power Platform Changes
uses: microsoft/AL-Go/Actions/[email protected]
with:
environmentName: 'Development'
solutionFolder: 'src/MySolution'
deploymentEnvironmentsJson: ${{ secrets.DEPLOYMENT_ENVIRONMENTS }}
Pull Changes with Direct Commit
- name: Pull Power Platform Changes
uses: microsoft/AL-Go/Actions/[email protected]
with:
environmentName: 'Development'
solutionFolder: 'MySolution'
deploymentEnvironmentsJson: ${{ secrets.DEPLOYMENT_ENVIRONMENTS }}
updateBranch: 'main'
directCommit: 'true'
Scheduled Pull Changes
name: Sync Power Platform Changes
on:
schedule:
- cron: '0 0 * * *' # Daily at midnight
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Pull Power Platform Changes
uses: microsoft/AL-Go/Actions/[email protected]
with:
environmentName: 'Development'
solutionFolder: 'PowerPlatformSolution'
deploymentEnvironmentsJson: ${{ secrets.DEPLOYMENT_ENVIRONMENTS }}
updateBranch: 'power-platform-sync'
directCommit: 'false'
Pull Multiple Solutions
strategy:
matrix:
solution:
- name: 'CoreSolution'
folder: 'src/CoreSolution'
- name: 'ExtensionSolution'
folder: 'src/ExtensionSolution'
steps:
- name: Pull ${{ matrix.solution.name }}
uses: microsoft/AL-Go/Actions/[email protected]
with:
environmentName: 'Development'
solutionFolder: ${{ matrix.solution.name }}
deploymentEnvironmentsJson: ${{ secrets.DEPLOYMENT_ENVIRONMENTS }}
Authentication
The action supports two authentication methods:
Username/Password Authentication
{
"Development": {
"ppUserName": "[email protected]",
"ppPassword": "***",
"ppEnvironmentUrl": "https://org.crm.dynamics.com"
}
}
Application ID Authentication
{
"Development": {
"ppTenantId": "tenant-guid",
"ppApplicationId": "app-guid",
"ppClientSecret": "***",
"ppEnvironmentUrl": "https://org.crm.dynamics.com"
}
}
Workflow
The action performs the following steps:
- Clones the repository to a temporary location
- Exports the solution from Power Platform as a .zip file
- Unpacks the solution to the specified folder
- Removes the .zip file
- Commits the changes to the repository
- Creates a pull request (if
directCommit is false) or pushes directly (if true)
This action is useful for keeping your repository in sync with changes made in Power Platform environments, enabling proper version control and team collaboration.
Ensure your deployment environment credentials have the necessary permissions to export solutions from the target Power Platform environment.