Commit graph

31 commits

Author SHA1 Message Date
Loup-Garou911XD
44cffc5cb5
Make plugin metadata idempotent by comparing against the base branch
auto_apply_plugin_metadata.py asked "what version is already released?" by
reading the category manifest out of the PR's own working tree. Once
ci-apply.yml has pushed its "[ci] apply-plugin-metadata-and-formatting"
commit back to the PR branch, that tree already lists the version being
added - so the check compared the new version against itself and raised
"Version cant be lower or equal than the previous version."

That fires on every re-run of PR Check: the one ci-apply.yml's own push
triggers, and any run caused by a contributor pushing a follow-up commit.

Published state now comes from the base branch instead, read with
`git show $PLUGMAN_BASE_REF:<manifest>` (ci-check.yml supplies the PR base
sha; local runs fall back to origin/main, then to the working tree). The
writer is idempotent to match: a version entry that is already stamped and
still matches the plugin's md5sum is left alone rather than reset to null.

An entry whose md5sum has drifted is still reset, which implements the TODO
this replaces - a contributor can keep iterating on an unpublished version
during review without bumping it every round. Bump enforcement against
published versions is unchanged.

Version comparison and ordering switch to the existing
get_comparable_version_tuple_from_string; versioning_tools.semantic_to_str
ordered 1.0.10 below 1.0.9 and silently truncated 3-digit components.
2026-08-10 13:30:20 +05:30
Loup-Garou911XD
bc5c5aafc8
Split ci.yml to close a pull_request_target pwn-request hole
pull_request_target checked out fork PR branches with the repo's
write-scoped GITHUB_TOKEN and ran autopep8/metadata scripts/tests
against that fork content, letting a malicious PR rewrite test/*.py
for arbitrary code execution with push access and secrets. It's also
been failing outright for weeks since actions/checkout now blocks
unsafe fork checkouts here without explicit opt-in.

Split into ci-check.yml (plain pull_request, GitHub's read-only
no-secrets token, safe to run fork code) which uploads a diff
artifact, and ci-apply.yml (workflow_run, privileged) which only
applies that diff via `git apply`, never executing fork content.
ci.yml keeps just the push-to-main job as the strict integrity check.

Because GitHub runs the PR's own copy of ci-check.yml for
pull_request events, that artifact is attacker-authored: ci-apply.yml
therefore resolves PR identity from the workflow_run payload plus the
API rather than the artifact, passes every dynamic value through env:
instead of ${{ }} in run: blocks (which the runner substitutes before
the shell parses, so quotes don't contain it), and validates branch,
repo, sha and PR-number shapes before use. The patch itself stays
untrusted input: allowlist-validated and applied only to the fork's
own branch.

test_checks.py adds an env-gated lenient mode so ci-check.yml's
preview run doesn't fail on a brand-new plugin's not-yet-existing
commit sha, while history and push-to-main stay strict.
2026-08-09 22:56:49 +05:30
Loup-Garou911XD
6a0b69ec74 add logging 2026-01-22 20:56:35 +05:30
Anas
b1183aadcf add powerup_manager 2026-01-21 23:43:39 +05:30
Loup-Garou911XD
c096985e94 autometa commit 2026-01-10 18:49:07 +05:30
Loup-Garou911XD
b7b57a0726 [ci] auto-format 2025-05-26 06:25:33 +00:00
Loup-Garou911XD
426ea06edc ci fix 2025-05-26 11:39:05 +05:30
Loup-Garou911XD
68e2fc481c fix 2025-01-15 04:25:43 +05:30
Loup-Garou911XD
9b1f5b6a63 [ci] auto-format 2025-01-14 22:46:36 +00:00
Loup-Garou911XD
9c1ff8b0f2 Updated ci and release workflow 2025-01-15 04:15:39 +05:30
Loup-Garou911XD
9fcf0386c5 added documentation 2024-04-20 09:06:50 +05:30
Loup-Garou911XD
281459cac1 Updated actiont to run on commit 2024-04-20 08:50:20 +05:30
Loup-Garou911XD
22a0ed0bd7 Fix5 2024-04-20 00:28:52 +05:30
Loup-Garou911XD
4294410d8a Fix4 2024-04-20 00:24:28 +05:30
Loup-Garou911XD
3a480dfff6 [ci] auto-format 2024-04-19 18:35:07 +00:00
Loup-Garou911XD
d07a276f1a get changes from CHANGELOG.md 2024-04-20 00:04:05 +05:30
Rikko
b93d1ff270
Improve error messages on common test failures 2023-10-06 20:48:34 +05:30
rikkolovescats
3464799b96 [ci] auto-format 2023-10-06 13:35:18 +00:00
Rikko
ce526371cb
Add a test for plugin manager changelog entries 2023-10-06 19:04:16 +05:30
Rikko
8dae6422a7 Add packaging dependency for running tests 2023-06-30 00:15:39 +05:30
Rikko
8770d7d82c Move away from deprecated distutils 2023-06-30 00:10:27 +05:30
Rikko
51a026611b Execute tests for maps 2023-06-16 00:12:14 +05:30
Rikko
6b7307a8c5 Yay, i taught it to sort! 2022-12-05 21:09:01 +05:30
! Freaku
c1feee14ec
Switching to HTTPS (6/6) 2022-11-30 18:35:17 +05:30
Rikko
a2a7d87c1c ci: sort plugin versions 2022-10-10 21:43:08 +05:30
Rikko
6998dedead Release v0.1.5 2022-09-08 01:27:21 +05:30
Rikko
29f531e515 autopep8 2022-08-31 19:26:52 +05:30
Rikko
f29008acdb Auto apply version metadata 2022-08-31 15:58:19 +05:30
Rikko
21c62f72f9 Add plugin meta tests 2022-08-31 06:18:24 +05:30
Rikko
74ca172fe6 Have a separate GH action for tests 2022-08-29 22:39:09 +05:30
Rikko
3f177bd27e Add tests 2022-08-29 22:31:28 +05:30