-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (41 loc) · 1.67 KB
/
MakeLocalizationChangelog.yaml
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: Update Localization Changelog
# Triggers when changes were made to the english translation config on the main branch
on:
push:
branches: [ main ]
paths:
- 'VolumeControl/Localization/en.loc*'
- 'VolumeControl.HotkeyActions/Localization/en.loc*'
jobs:
update-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
persist-credentials: true
# Get changed files
- uses: tj-actions/[email protected]
id: changes
with:
include_all_old_new_renamed_files: true
files: |
VolumeControl/Localization/*.loc*
VolumeControl.HotkeyActions/Localization/*.loc*
# Build issue comment
- name: "Build comment body"
if: steps.changes.outputs.modified_files_count != 0
run: |
printf -- "| Date | Commit | User |\n" >> body.md
printf -- "|------|--------|------|\n" >> body.md
printf -- "| %s | %s | %s |\n\n" "$(date +%F)" "${{ github.sha }}" "${{ github.actor }}" >> body.md
for file in ${{ steps.changes.outputs.modified_files }}; do
printf -- "- [\`%s\`](../blob/${{ github.sha }}/%s) \n \`\`\`diff\n%s\n \`\`\`\n" "$file" "$file" "$(git diff -p HEAD HEAD~1 VolumeControl/Localization/en.loc.json | tail -n +6 | awk '$0=" "$0')" >> body.md
done
# Add comment to changelog issue
- name: Add Comment to Changelog
if: steps.changes.outputs.modified_files_count != 0
uses: peter-evans/[email protected]
with:
issue-number: 134
body-path: 'body.md'