mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
github/update: improve summary for generated files
This commit is contained in:
parent
bd1dddaf50
commit
cff06c8570
1 changed files with 11 additions and 4 deletions
15
.github/workflows/update.yml
vendored
15
.github/workflows/update.yml
vendored
|
@ -71,10 +71,17 @@ jobs:
|
||||||
nix run .#generate-files -- --commit
|
nix run .#generate-files -- --commit
|
||||||
new=$(git show --no-patch --format=%h)
|
new=$(git show --no-patch --format=%h)
|
||||||
if [ "$old" != "$new" ]; then
|
if [ "$old" != "$new" ]; then
|
||||||
summary=$(git show --no-patch --format=%s)
|
body=$(git show --no-patch --format=%b)
|
||||||
echo "summary=$summary" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
||||||
git show --no-patch --format=%b >> "$GITHUB_OUTPUT"
|
if [ -n "$body" ]; then
|
||||||
|
# Multi-file changes are listed in the body
|
||||||
|
echo "$body" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
# Single-file changes are only in the summary,
|
||||||
|
# e.g. "generated: Updated none-ls.nix"
|
||||||
|
git show --no-patch --format=%s | \
|
||||||
|
sed -e 's/^generated:/-/' >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -96,7 +103,7 @@ jobs:
|
||||||
```
|
```
|
||||||
|
|
||||||
## Generate
|
## Generate
|
||||||
${{ steps.generate.outputs.body || steps.generate.outputs.summary || 'No changes' }}
|
${{ steps.generate.outputs.body || 'No changes' }}
|
||||||
|
|
||||||
- name: Print summary
|
- name: Print summary
|
||||||
if: ${{ steps.pr.outputs.pull-request-number }}
|
if: ${{ steps.pr.outputs.pull-request-number }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue