-
Notifications
You must be signed in to change notification settings - Fork 3.4k
49 lines (39 loc) · 1.3 KB
/
icon_update.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
name: Icon Update
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
env:
GH_TOKEN: ${{ secrets.SA_PAT }}
defaults:
run:
shell: pwsh
jobs:
build:
#This check prevents this from running on forks
if: ${{ github.repository == 'MaterialDesignInXAML/MaterialDesignInXamlToolkit' }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
- name: Run Icon Generation
run: dotnet run -c Release -- icons
working-directory: ./mdresgen
- name: Check for changes
id: check_for_changes
run: |
$hasChanges = $((git status --porcelain).Length -gt 0).ToString().ToLower()
"has_changes=$hasChanges" >> $env:GITHUB_OUTPUT
- name: Open Pull Request
if: ${{ steps.check_for_changes.outputs.has_changes == 'true' }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git checkout -b "automated/icon_update"
git commit -m "[bot] Pack Icon update" --all
git push -f --set-upstream origin automated/icon_update
gh pr create --fill
gh pr merge automated/icon_update --delete-branch --auto --squash