export-and-branch-solution #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: export-and-branch-solution | |
# Export solution from DEV environment | |
# unpack it and prepare, commit and push a git branch with the changes | |
on: | |
workflow_dispatch: | |
inputs: | |
# Change this value | |
solution_name: | |
description: 'name of the solution to worked on from Power Platform' | |
required: true | |
default: GG_Bot_Core | |
#Do Not change these values | |
solution_exported_folder: | |
description: 'folder name for staging the exported solution *do not change*' | |
required: true | |
default: out/exported/ | |
solution_folder: | |
description: 'staging the unpacked solution folder before check-in *do not change*' | |
required: true | |
default: out/solutions/ | |
solution_target_folder: | |
description: 'folder name to be created and checked in *do not change*' | |
required: true | |
default: solutions/ | |
env: | |
#edit your values here | |
ENVIRONMENT_URL: 'https://garage-stage.crm4.dynamics.com' | |
CLIENT_ID: '793b583d-50d6-4ffa-8d92-4cab6eb12af3' | |
TENANT_ID: '69879a40-68bb-4b30-941b-eb9692ddd9b4' | |
permissions: | |
contents: write | |
jobs: | |
export-from-dev: | |
#runs-on: windows-latest | |
runs-on: ubuntu-latest | |
# or you can say runs-on: ubuntu-latest | |
env: | |
RUNNER_DEBUG: 1 | |
steps: | |
- name: Checkout REPO | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install Power Platform Tools | |
uses: microsoft/powerplatform-actions/actions-install@v1 | |
- name: who-am-i action | |
uses: microsoft/powerplatform-actions/who-am-i@v0 | |
with: | |
environment-url: ${{env.ENVIRONMENT_URL}} | |
app-id: ${{env.CLIENT_ID}} | |
client-secret: ${{ secrets.POWERPLATFORMSPN }} | |
tenant-id: ${{env.TENANT_ID}} | |
- name: export-solution action | |
uses: microsoft/powerplatform-actions/export-solution@v1 | |
with: | |
environment-url: ${{env.ENVIRONMENT_URL}} | |
app-id: ${{env.CLIENT_ID}} | |
client-secret: ${{ secrets.PowerPlatformSPN }} | |
tenant-id: ${{env.TENANT_ID}} | |
solution-name: ${{ github.event.inputs.solution_name }} | |
solution-output-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip | |
- name: export-solution action -managed | |
uses: microsoft/powerplatform-actions/export-solution@v1 | |
with: | |
environment-url: ${{env.ENVIRONMENT_URL}} | |
app-id: ${{env.CLIENT_ID}} | |
client-secret: ${{ secrets.PowerPlatformSPN }} | |
tenant-id: ${{env.TENANT_ID}} | |
solution-name: ${{ github.event.inputs.solution_name }} | |
managed: true | |
solution-output-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}_managed.zip | |
- name: unpack-solution action | |
uses: microsoft/powerplatform-actions/unpack-solution@v1 | |
with: | |
solution-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip | |
solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} | |
solution-type: 'Both' | |
overwrite-files: true | |
- name: branch-solution, prepare it for a PullRequest | |
uses: microsoft/powerplatform-actions/branch-solution@v1 | |
with: | |
solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} | |
solution-target-folder: ${{ github.event.inputs.solution_target_folder}}/${{ github.event.inputs.solution_name }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
allow-empty-commit: true |