Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,20 @@ jobs:
if [ $EXISTING_PR -eq 0 ]
then
TITLE="syslog-ng-cfg-helper: $VERSION"
BODY="Generate from https://pypi.org/project/syslog-ng-cfg-helper/$VERSION"
BODY=$(mktemp)
echo "Generated from https://pypi.org/project/syslog-ng-cfg-helper/$VERSION" > $BODY
echo >> $BODY
echo 'For your convenience, here is a human-readable diff of the change:' >> $BODY
echo '```diff' >> $BODY
set +e
diff -u --label a/syntax/syslog-ng.vim <(git diff syntax/syslog-ng.vim | grep '^-syn keyword' | tr ' ' '\n' | tail -n +3) \
--label b/syntax/syslog-ng.vim <(git diff syntax/syslog-ng.vim | grep '^+syn keyword' | tr ' ' '\n' | tail -n +3) >> $BODY
set -e
echo '```' >> $BODY
git switch -c "$BRANCH"
git commit -a -s -m "$TITLE"
git push --force origin "$BRANCH"
gh pr create --title "$TITLE" --body "$BODY"
gh pr create --title "$TITLE" --body-file "$BODY"
else
echo "Pull Request already exists"
fi
Expand Down
2 changes: 1 addition & 1 deletion generate
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ db = JSON.parse(File.read(ARGV[0]))
def find_keywords(hash)
keywords = []
hash.each do |key, value|
if key == 'name' && value && !value.start_with?('<')
if key == 'name' && value && value.is_a?(String) && !value.start_with?('<')
keywords << value
keywords << value.gsub('-', '_')
elsif value.is_a?(Hash)
Expand Down
Loading