Icon Update #503
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: 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: Run Icon Generation | |
run: dotnet run -c Release -- icons | |
working-directory: ./src/MaterialDesignToolkit.ResourceGeneration | |
- 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 |