Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: support multiple author in sync GH #378

Merged
merged 1 commit into from
May 11, 2021
Merged

Conversation

Ana06
Copy link
Member

@Ana06 Ana06 commented May 11, 2021

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

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
@Ana06 Ana06 added bug Something isn't working CI Continous integration labels May 11, 2021
@Ana06 Ana06 requested a review from mr-tz May 11, 2021 10:45
Copy link
Collaborator

@mr-tz mr-tz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@mr-tz mr-tz merged commit 376e217 into mandiant:master May 11, 2021
import sys

rule_file = sys.argv[1]
with open(rule_file, 'r') as stream:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend: prefer to use rb with an explicit call to f.read().decode("utf-8")

no need to change here, just mentioning it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please elaborate on why?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be clear, this is a personal style thing.

basically, because the behavior here is platform-dependent:

image

while it probably doesn't matter in this case (CI is always going to be linux, and files never shared across platforms) doing things explicitly prevents subtle bugs for creeping in when files might be shared. therefore, i default to using explicit encodings in all cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation @williballenthin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CI Continous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The sync GH action only works for a single author
4 participants