-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: support multiple author in sync GH
The sync GH action only works for a single author, producing unexpected results when using list of authors. This change also prevent problems with new files that are not rules (`.yml`). (such as `.github/scripts/changelog_author.py`) Closes mandiant/capa#555
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import yaml | ||
import sys | ||
|
||
rule_file = sys.argv[1] | ||
with open(rule_file, 'r') as stream: | ||
rule_yaml = yaml.safe_load(stream) | ||
|
||
author_value = rule_yaml["rule"]["meta"]["author"] | ||
if isinstance(author_value, list): # list of authors | ||
print(" ".join(author_value)) | ||
else: # one author | ||
print(author_value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e1643cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.