Skip to content

Commit c97caa5

Browse files
Draft 1
1 parent dd3d17f commit c97caa5

6 files changed

Lines changed: 836 additions & 2 deletions

File tree

.github/workflows/render-icons.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Render SCIM icons
2+
3+
on:
4+
push:
5+
paths:
6+
- bh-scim-extension.json
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
render-icons:
13+
runs-on: windows-latest
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Render node icons
19+
shell: pwsh
20+
run: |
21+
./Icons/Render-CustomNodeIcons.ps1 -InputFile ./bh-scim-extension.json -OutputDir ./Icons
22+
23+
- name: Detect changes
24+
id: changes
25+
shell: pwsh
26+
run: |
27+
[string] $status = git status --porcelain
28+
if ([string]::IsNullOrWhiteSpace($status)) {
29+
"No changes." | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
30+
"has_changes=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
31+
return
32+
}
33+
34+
"Files changed:" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
35+
# Substring(3) strips the two-character status code and following space to leave just the file path.
36+
[string[]] $files = $status -split "`n" | Where-Object { -not [string]::IsNullOrWhiteSpace($PSItem) } | ForEach-Object { $PSItem.Trim() } | ForEach-Object { $PSItem.Substring(3) }
37+
foreach ($file in $files) {
38+
"- $file" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
39+
}
40+
41+
"has_changes=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
42+
43+
- name: Commit and push changes
44+
if: steps.changes.outputs.has_changes == 'true'
45+
shell: pwsh
46+
run: |
47+
git config user.name "github-actions[bot]"
48+
git config user.email "github-actions[bot]@users.noreply.github.com"
49+
git add -A
50+
git commit -m "Update SCIM icons"
51+
git push

0 commit comments

Comments
 (0)