-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (74 loc) · 2.98 KB
/
export-and-commit-solution.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: export-and-commit-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: InventoryOnHand
env:
#edit your values here
ENVIRONMENT_URL: 'https://msbuild2023-dev.crm.dynamics.com/'
CLIENT_ID: '32c5ecf8-c5dd-4bb9-adee-401a0d26e32e'
TENANT_ID: 'b76e8d49-9a4e-4d86-a364-b254bbd31c37'
permissions:
contents: write
jobs:
export-from-dev:
runs-on: ubuntu-latest
# or you can say runs-on: ubuntu-latest
env:
RUNNER_DEBUG: 1
steps:
- uses: actions/checkout@v2
with:
lfs: true
- 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@v0
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.repository.name}}/${{ github.event.inputs.solution_name }}_unmanaged.zip
overwrite: true
- name: unpack-solution action
uses: microsoft/powerplatform-actions/unpack-solution@v0
with:
solution-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}_unmanaged.zip
solution-folder: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}
solution-type: 'Unmanaged'
overwrite-files: true
process-canvas-apps: true
- name: export-managed-solution
uses: microsoft/powerplatform-actions/export-solution@v0
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.repository.name }}/${{ github.event.inputs.solution_name }}_managed.zip
overwrite: true
managed: true
- name: Git Fetch and Commit
run: |
git fetch --all
git config --global user.email "no-reply@github.com"
git config --global user.name "GitHub Actions"
git checkout master
git add --all
git commit -m "Updates from the dev environment" --allow-empty
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push