aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/halloween/hacktoberstats.py
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-11-16 15:33:49 +0100
committerGravatar Sebastiaan Zeeff <[email protected]>2020-11-16 15:47:18 +0100
commit012cfa8f5bcc7a2830a8292989ec33f6e9677410 (patch)
treea0f85f0809e87a95ec9ae085983909bfd986a661 /bot/exts/halloween/hacktoberstats.py
parentMerge pull request #517 from python-discord/sebastiaan/backend/remove-dockerh... (diff)
Ensure flake8 runs correctly in Pull Request check
Unfortunately, the flake8 action we were using from the marketplace required us to use the `pull_request_target` event, which runs in the context of the target repository to protect secrets. However, this also meant that flake8 would run on files already merged into our master branch, not the actual changes made in teh PR! That's obviously pretty useless as a guard against merging linting errors into our repository. This change sidesteps the issue by removing the marketplace action and replacing it by a direct `flake8` run command. To make sure error output ends up as a GitHub Actions Annotation, we ask `flake8` to format its error messages using the correct GitHub Workflow Command format: ::error file={filename},line={line},col={col}::{message} Whenever something is printed to stdout/stderr in that format, GitHub Actions will automatically interpret it as the "register error message" workflow command. Since this doesn't require a GitHub Token with "write" permissions, we can now switch back to the safer `pull_request` event that gets a read-only GitHub Token.
Diffstat (limited to 'bot/exts/halloween/hacktoberstats.py')
0 files changed, 0 insertions, 0 deletions