• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 25441711719

06 May 2026 02:31PM UTC coverage: 92.915%. Remained the same
25441711719

push

github

web-flow
use sha pin (with comment) format for generated actions (#23312)

Per the GitHub Action best practices we recently enabled at #23249, we
should pin each action to a SHA so that the reference is actually
immutable.

This will -- I hope -- knock out a large chunk of the 421 alerts we
currently get from zizmor. The next followup would then be upgrades and
harmonizing the generated and none-generated pins.

Notice: This idea was suggested by Claude while going over pinact output
and I was surprised to see that post processing the yaml wasn't too
gross.

92206 of 99237 relevant lines covered (92.91%)

4.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.48
/src/python/pants/engine/platform.py
1
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
12✔
5

6
from enum import StrEnum
12✔
7

8
from pants.util.osutil import get_normalized_arch_name, get_normalized_os_name
12✔
9

10

11
class PlatformError(Exception):
12✔
12
    """Raise when an attempt is made to execute a process on a platform where it cannot succeed.
13

14
    E.g., because it requires a tool that is not supported on the platform.
15
    """
16

17

18
class Platform(StrEnum):
12✔
19
    linux_arm64 = "linux_arm64"
12✔
20
    linux_x86_64 = "linux_x86_64"
12✔
21
    macos_arm64 = "macos_arm64"
12✔
22
    macos_x86_64 = "macos_x86_64"
12✔
23

24
    @property
12✔
25
    def is_macos(self) -> bool:
12✔
26
        return self in [Platform.macos_arm64, Platform.macos_x86_64]
11✔
27

28
    @classmethod
12✔
29
    def create_for_localhost(cls) -> Platform:
12✔
30
        """Creates a Platform instance for localhost.
31

32
        This method should never be accessed directly by `@rules`: instead, to get the currently
33
        active `Platform`, they should request a `Platform` as a positional argument.
34
        """
35
        return Platform(f"{get_normalized_os_name()}_{get_normalized_arch_name()}")
12✔
36

37
    def for_linux(self) -> Platform:
12✔
38
        """Returns a Platform instance representing Linux on the Platform's architecture.
39

40
        Useful for fetching docker images runnable directly on the local architecture.
41
        """
42
        if self == Platform.macos_x86_64:
1✔
43
            return Platform.linux_x86_64
×
44
        elif self == Platform.macos_arm64:
1✔
45
            return Platform.linux_arm64
×
46
        else:
47
            return self
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc