Skip to content

Commit e7ec566

Browse files
authored
Merge pull request #11 from syslog-ng/fix-upgrade-action
Fix the "upgrade" GitHub Action
2 parents 16a053b + ae1a649 commit e7ec566

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/upgrade.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,20 @@ jobs:
4646
if [ $EXISTING_PR -eq 0 ]
4747
then
4848
TITLE="syslog-ng-cfg-helper: $VERSION"
49-
BODY="Generate from https://pypi.org/project/syslog-ng-cfg-helper/$VERSION"
49+
BODY=$(mktemp)
50+
echo "Generated from https://pypi.org/project/syslog-ng-cfg-helper/$VERSION" > $BODY
51+
echo >> $BODY
52+
echo 'For your convenience, here is a human-readable diff of the change:' >> $BODY
53+
echo '```diff' >> $BODY
54+
set +e
55+
diff -u --label a/syntax/syslog-ng.vim <(git diff syntax/syslog-ng.vim | grep '^-syn keyword' | tr ' ' '\n' | tail -n +3) \
56+
--label b/syntax/syslog-ng.vim <(git diff syntax/syslog-ng.vim | grep '^+syn keyword' | tr ' ' '\n' | tail -n +3) >> $BODY
57+
set -e
58+
echo '```' >> $BODY
5059
git switch -c "$BRANCH"
5160
git commit -a -s -m "$TITLE"
5261
git push --force origin "$BRANCH"
53-
gh pr create --title "$TITLE" --body "$BODY"
62+
gh pr create --title "$TITLE" --body-file "$BODY"
5463
else
5564
echo "Pull Request already exists"
5665
fi

generate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ db = JSON.parse(File.read(ARGV[0]))
1616
def find_keywords(hash)
1717
keywords = []
1818
hash.each do |key, value|
19-
if key == 'name' && value && !value.start_with?('<')
19+
if key == 'name' && value && value.is_a?(String) && !value.start_with?('<')
2020
keywords << value
2121
keywords << value.gsub('-', '_')
2222
elsif value.is_a?(Hash)

0 commit comments

Comments
 (0)