Implement strict security controls in continuous integration and deployment workflows:

  1. Pin external GitHub Actions to immutable commit hashes rather than mutable tags: ```yaml

    Instead of this (vulnerable to supply chain attacks):

    Use this (pinned to specific commit):

  2. Isolate workflows requiring elevated permissions into separate files for clearer security boundaries:
    # Separate high-privilege workflows (e.g., update-nix-hash.yml) from regular CI workflows
    permissions:
      contents: write  # Clearly visible elevated permission
    
  3. Apply the principle of least privilege by:
  4. Thoroughly review scripts running with elevated permissions to protect against:

Implementing these practices prevents supply chain attacks and reduces the risk of compromised workflows affecting your repository.