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

local precommit doesn't match github runner verison #45

Closed
VVX7 opened this issue Aug 29, 2023 · 1 comment
Closed

local precommit doesn't match github runner verison #45

VVX7 opened this issue Aug 29, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@VVX7
Copy link
Contributor

VVX7 commented Aug 29, 2023

What happened?

Steps to reproduce:

  1. Follow the project readme to install repository prerequisites in a local environment (asdf, mage, pre-commit).
  2. Add a markdown file that fails Github's precommit tests Add ttp dev doc #44
  3. Run the tests.

Expected:
Tests should fail locally as they do in Github.

Actual:
All tests pass in local precommit environment.

Any suggestions for fixing this bug?

No response

Relevant log output

bash-3.2$ mage runprecommit
Updating pre-commit hooks.
Clearing the pre-commit cache to ensure we have a fresh start.
Running all pre-commit hooks locally.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:[email protected].
[INFO] Initializing environment for https://github.com/koalaman/shellcheck-precommit.
[INFO] Initializing environment for https://github.com/jumanjihouse/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/jumanjihouse/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
check for added large files..............................................Passed
detect private key.......................................................Passed
check that scripts with shebangs are executable..........................Passed
yamllint.................................................................Passed
prettier.................................................................Passed
ShellCheck v0.9.0........................................................Passed
Ensure shell scripts end with .sh........................................Passed
Check shell style with shfmt.............................................Passed
Check markdown files.....................................................Passed
codespell................................................................Passed
Ensure all go files have the copyright header............................Passed


### Details about your environment

## Env

bash-3.2$ sw_vers
ProductName: macOS
ProductVersion: 13.5
BuildVersion: 22G74

bash-3.2$ which mage
/Users/vvx7/.asdf/installs/golang/1.21.0/packages/bin/mage

bash-3.2$ which go
/Users/vvx7/.asdf/shims/go

bash-3.2$ go version
go version go1.21.0 darwin/amd64

@VVX7 VVX7 added the bug Something isn't working label Aug 29, 2023
@l50
Copy link
Contributor

l50 commented Aug 31, 2023

I ran it on several OSes today and was greeted with the same issues as the pre-commit action:

Updating pre-commit hooks.
Clearing the pre-commit cache to ensure we have a fresh start.
Running all pre-commit hooks locally.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:[email protected].
[INFO] Initializing environment for https://github.com/koalaman/shellcheck-precommit.
[INFO] Initializing environment for https://github.com/jumanjihouse/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/jumanjihouse/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
fix end of files.........................................................Failed

  • hook id: end-of-file-fixer
  • exit code: 1
  • files were modified by this hook

Fixing docs/ttp-dev.md

trim trailing whitespace.................................................Failed

  • hook id: trailing-whitespace
  • exit code: 1
  • files were modified by this hook

Fixing docs/ttp-dev.md

check for added large files..............................................Passed
detect private key.......................................................Passed
check that scripts with shebangs are executable..........................Passed
yamllint.................................................................Passed
prettier.................................................................Passed
ShellCheck v0.9.0........................................................Passed
Ensure shell scripts end with .sh........................................Passed
Check shell style with shfmt.............................................Passed
Check markdown files.....................................................Failed

  • hook id: markdownlint
  • exit code: 1

args: ttps/macOS/README.md ttps/cloud/aws/secretsmanager/steal-secretsmanager-secret/README.md README.md ttps/examples/outputs/README.md

args: ttps/examples/args/README.md ttps/discovery/get-running-processes/README.md .github/CODE_OF_CONDUCT.md .github/CONTRIBUTING.md

args: ttps/persistence/ssh/backdoor-ssh-authorized-keys/README.md .github/ISSUE_TEMPLATE.md ttps/cloud/aws/iam/revive-old-iam-user/README.md .github/PULL_REQUEST_TEMPLATE.md

args: ttps/cloud/aws/iam/escalate-old-iam-user/README.md ttps/privilege-escalation/credential-theft/enumerate-creds-lazagne/README.md docs/ttp-dev.md ttps/defense-evasion/macos/disable-system-updates/README.md

docs/ttp-dev.md:178: MD010 Hard tabs
docs/ttp-dev.md:101: MD012 Multiple consecutive blank lines
docs/ttp-dev.md:157: MD031 Fenced code blocks should be surrounded by blank lines
docs/ttp-dev.md:174: MD031 Fenced code blocks should be surrounded by blank lines
docs/ttp-dev.md:165: MD046 Code block style

A detailed description of the rules is available at https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md
args: ttps/cloud/aws/iam/enumerate-iam/README.md ttps/persistence/macos/launch-agent-persistence/README.md

codespell................................................................Passed
Ensure all go files have the copyright header............................Passed
pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: pre-commit run --all-files.
To run pre-commit as part of git workflow, use pre-commit install.
All changes made by hooks:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5d1609f..37abc79 100755
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -19,7 +19,7 @@ repos:
entry: yamllint --strict -c .hooks/linters/yamllint.yaml

  • rev: v3.0.3
    hooks:
    • id: prettier
      files: .(json|yaml|yml)$
      diff --git a/docs/ttp-dev.md b/docs/ttp-dev.md
      index bce05f0..7f45bc2 100644
      --- a/docs/ttp-dev.md
      +++ b/docs/ttp-dev.md
      @@ -1,20 +1,20 @@

TTP Development

-This document introduces concepts to help developers
+This document introduces concepts to help developers
create their own TTPs for use in TTPForge.

TTP Anatomy

-ForgeArmory TTPs are designed to be consumed by TTPForge,
-which provides an interface to execute TTPs across various targets and mediums.
-Each ForgeArmory TTP consists of metadata and optional argument declarations.
+ForgeArmory TTPs are designed to be consumed by TTPForge,
+which provides an interface to execute TTPs across various targets and mediums.
+Each ForgeArmory TTP consists of metadata and optional argument declarations.
The steps define the TTP implementation logic.

Metadata

-TTP metadata must include the name of the TTP and a description of that TTP's
-behavior. MITRE ATT&CK IDs are optional but recommended. If the TTP cannot be
-mapped to MITRE ATT&CK then the mitre mapping and its child mappings should be
+TTP metadata must include the name of the TTP and a description of that TTP's
+behavior. MITRE ATT&CK IDs are optional but recommended. If the TTP cannot be
+mapped to MITRE ATT&CK then the mitre mapping and its child mappings should be
omitted.

An example of TTP metadata is shown below.
@@ -36,9 +36,9 @@ mitre:

Arguments

-Arguments are defined after the TTP metadata. Arguments are uniquely named,
-may be strongly typed, and may contain default values. Using an argument in
-the TTP is done with the argument syntax, {{ .Args.arg_name }}.
+Arguments are defined after the TTP metadata. Arguments are uniquely named,
+may be strongly typed, and may contain default values. Using an argument in
+the TTP is done with the argument syntax, {{ .Args.arg_name }}.
A complete example is shown below.

@@ -58,7 +58,7 @@ steps:

### Steps

-Steps are uniquely named blocks of implementation logic which are executed in
+Steps are uniquely named blocks of implementation logic which are executed in
sequence. Steps help developers organize and manage the complexity of TTPs.

In general, steps will fall into one of the following high-level categories;
@@ -68,16 +68,16 @@ In general, steps will fall into one of the following high-level categories;
- Execution
- Cleanup

-Additionally, TTPs may be daisy-chained enabling developers to create complex
-sequences of TTPs. In doing so, each daisy-chained TTP is represented in the
-parent TTP as a sub-TTP. We'll see an example of this shortly and some
+Additionally, TTPs may be daisy-chained enabling developers to create complex
+sequences of TTPs. In doing so, each daisy-chained TTP is represented in the
+parent TTP as a sub-TTP. We'll see an example of this shortly and some
recommendations on developing sub-TTPs as common building blocks.

#### Assessment

-It is often necessary for a TTP to test execution requirements, such as whether
-a necessary environment variable is set, and bail out of the TTP if it is not.
-In this example, if the `AWS_DEFAULT_REGION` environment variable is not set,
+It is often necessary for a TTP to test execution requirements, such as whether
+a necessary environment variable is set, and bail out of the TTP if it is not.
+In this example, if the `AWS_DEFAULT_REGION` environment variable is not set,
the TTP returns exit code 1 and no further blocks are executed.

```yaml
@@ -90,20 +90,20 @@ steps:
          echo "Error: AWS_DEFAULT_REGION must be set."
          exit 1
      fi
-
+
<- snip ->

-When creating assessment type blocks, it's preferable to place each test in its
+When creating assessment type blocks, it's preferable to place each test in its
own block rather than a single block that tests all prerequisites. This approach
will make your TTPs much easier to maintain as they become more complex.

Shaping

-It is often necessary for a TTP to install dependencies, stage files, or shape
+It is often necessary for a TTP to install dependencies, stage files, or shape
the target environment prior to executing the core TTP logic. As with assessment
-type blocks, when creating shaping type blocks, it's preferable to place each
+type blocks, when creating shaping type blocks, it's preferable to place each
action in its own block.

@@ -124,18 +124,18 @@ action in its own block.

#### Execution

-The execution blocks contain the core TTP logic. A single execution block may
+The execution blocks contain the core TTP logic. A single execution block may
be sufficient for simple TTPs such as atomics, which contain a single procedure.
-For complex TTPs, the core logic should be broken up across multiple steps or
-sub-TTPs. In general, if the core logic implements multiple procedures or the
+For complex TTPs, the core logic should be broken up across multiple steps or
+sub-TTPs. In general, if the core logic implements multiple procedures or the
procedure can be reasonably divided, refactoring into smaller steps will enhance
maintainability.

-Code likely to be reused in other TTPs should be placed in a sub-TTP and imported
-where needed. It's easier to maintain building blocks than to modify the same
-(reimplemented) code in multiple places. Good candidates for sub-TTPs include
-assessment and shaping operations. Here, you might check for commonly used
-prerequisites, install frequent tools, or tamper with security controls before
+Code likely to be reused in other TTPs should be placed in a sub-TTP and imported
+where needed. It's easier to maintain building blocks than to modify the same
+(reimplemented) code in multiple places. Good candidates for sub-TTPs include
+assessment and shaping operations. Here, you might check for commonly used
+prerequisites, install frequent tools, or tamper with security controls before
the primary execution block.

```yaml
@@ -148,11 +148,11 @@ steps:

#### Cleanup

-In addition to the implementation logic, each TTP must contain a `cleanup` block
-to revert artifacts from the preceding blocks. If no implementation blocks produce
+In addition to the implementation logic, each TTP must contain a `cleanup` block
+to revert artifacts from the preceding blocks. If no implementation blocks produce
artifacts, the `cleanup` block should just return a success log.

-Example with implementation block artifacts: Here, we revert changes made in
+Example with implementation block artifacts: Here, we revert changes made in
previous steps.
```yaml
steps:
@@ -169,7 +169,7 @@ steps:
        echo "[+] DONE!"

-Example without implementation block artifacts: No changes were made to the
+Example without implementation block artifacts: No changes were made to the
target system. This is reported in the success log.

steps:
@@ -182,4 +182,3 @@ steps:
      inline: |
        echo "No cleanup needed, as this TTP simply dumped clipboard contents to stdout."

Error: failed to run pre-commit with args [run --all-files --show-diff-on-failure]: stdout: [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:[email protected].
[INFO] Initializing environment for https://github.com/koalaman/shellcheck-precommit.
[INFO] Initializing environment for https://github.com/jumanjihouse/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/jumanjihouse/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
fix end of files.........................................................Failed

  • hook id: end-of-file-fixer
  • exit code: 1
  • files were modified by this hook

Fixing docs/ttp-dev.md

trim trailing whitespace.................................................Failed

  • hook id: trailing-whitespace
  • exit code: 1
  • files were modified by this hook

Fixing docs/ttp-dev.md

check for added large files..............................................Passed
detect private key.......................................................Passed
check that scripts with shebangs are executable..........................Passed
yamllint.................................................................Passed
prettier.................................................................Passed
ShellCheck v0.9.0........................................................Passed
Ensure shell scripts end with .sh........................................Passed
Check shell style with shfmt.............................................Passed
Check markdown files.....................................................Failed

  • hook id: markdownlint
  • exit code: 1

args: ttps/macOS/README.md ttps/cloud/aws/secretsmanager/steal-secretsmanager-secret/README.md README.md ttps/examples/outputs/README.md

args: ttps/examples/args/README.md ttps/discovery/get-running-processes/README.md .github/CODE_OF_CONDUCT.md .github/CONTRIBUTING.md

args: ttps/persistence/ssh/backdoor-ssh-authorized-keys/README.md .github/ISSUE_TEMPLATE.md ttps/cloud/aws/iam/revive-old-iam-user/README.md .github/PULL_REQUEST_TEMPLATE.md

args: ttps/cloud/aws/iam/escalate-old-iam-user/README.md ttps/privilege-escalation/credential-theft/enumerate-creds-lazagne/README.md docs/ttp-dev.md ttps/defense-evasion/macos/disable-system-updates/README.md

docs/ttp-dev.md:178: MD010 Hard tabs
docs/ttp-dev.md:101: MD012 Multiple consecutive blank lines
docs/ttp-dev.md:157: MD031 Fenced code blocks should be surrounded by blank lines
docs/ttp-dev.md:174: MD031 Fenced code blocks should be surrounded by blank lines
docs/ttp-dev.md:165: MD046 Code block style

A detailed description of the rules is available at https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md
args: ttps/cloud/aws/iam/enumerate-iam/README.md ttps/persistence/macos/launch-agent-persistence/README.md

codespell................................................................Passed
Ensure all go files have the copyright header............................Passed
pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: pre-commit run --all-files.
To run pre-commit as part of git workflow, use pre-commit install.
All changes made by hooks:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5d1609f..37abc79 100755
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -19,7 +19,7 @@ repos:
entry: yamllint --strict -c .hooks/linters/yamllint.yaml

  • rev: v3.0.3
    hooks:
    • id: prettier
      files: .(json|yaml|yml)$
      diff --git a/docs/ttp-dev.md b/docs/ttp-dev.md
      index bce05f0..7f45bc2 100644
      --- a/docs/ttp-dev.md
      +++ b/docs/ttp-dev.md
      @@ -1,20 +1,20 @@

TTP Development

-This document introduces concepts to help developers
+This document introduces concepts to help developers
create their own TTPs for use in TTPForge.

TTP Anatomy

-ForgeArmory TTPs are designed to be consumed by TTPForge,
-which provides an interface to execute TTPs across various targets and mediums.
-Each ForgeArmory TTP consists of metadata and optional argument declarations.
+ForgeArmory TTPs are designed to be consumed by TTPForge,
+which provides an interface to execute TTPs across various targets and mediums.
+Each ForgeArmory TTP consists of metadata and optional argument declarations.
The steps define the TTP implementation logic.

Metadata

-TTP metadata must include the name of the TTP and a description of that TTP's
-behavior. MITRE ATT&CK IDs are optional but recommended. If the TTP cannot be
-mapped to MITRE ATT&CK then the mitre mapping and its child mappings should be
+TTP metadata must include the name of the TTP and a description of that TTP's
+behavior. MITRE ATT&CK IDs are optional but recommended. If the TTP cannot be
+mapped to MITRE ATT&CK then the mitre mapping and its child mappings should be
omitted.

An example of TTP metadata is shown below.
@@ -36,9 +36,9 @@ mitre:

Arguments

-Arguments are defined after the TTP metadata. Arguments are uniquely named,
-may be strongly typed, and may contain default values. Using an argument in
-the TTP is done with the argument syntax, {{ .Args.arg_name }}.
+Arguments are defined after the TTP metadata. Arguments are uniquely named,
+may be strongly typed, and may contain default values. Using an argument in
+the TTP is done with the argument syntax, {{ .Args.arg_name }}.
A complete example is shown below.

@@ -58,7 +58,7 @@ steps:

### Steps

-Steps are uniquely named blocks of implementation logic which are executed in
+Steps are uniquely named blocks of implementation logic which are executed in
sequence. Steps help developers organize and manage the complexity of TTPs.

In general, steps will fall into one of the following high-level categories;
@@ -68,16 +68,16 @@ In general, steps will fall into one of the following high-level categories;
- Execution
- Cleanup

-Additionally, TTPs may be daisy-chained enabling developers to create complex
-sequences of TTPs. In doing so, each daisy-chained TTP is represented in the
-parent TTP as a sub-TTP. We'll see an example of this shortly and some
+Additionally, TTPs may be daisy-chained enabling developers to create complex
+sequences of TTPs. In doing so, each daisy-chained TTP is represented in the
+parent TTP as a sub-TTP. We'll see an example of this shortly and some
recommendations on developing sub-TTPs as common building blocks.

#### Assessment

-It is often necessary for a TTP to test execution requirements, such as whether
-a necessary environment variable is set, and bail out of the TTP if it is not.
-In this example, if the `AWS_DEFAULT_REGION` environment variable is not set,
+It is often necessary for a TTP to test execution requirements, such as whether
+a necessary environment variable is set, and bail out of the TTP if it is not.
+In this example, if the `AWS_DEFAULT_REGION` environment variable is not set,
the TTP returns exit code 1 and no further blocks are executed.

```yaml
@@ -90,20 +90,20 @@ steps:
          echo "Error: AWS_DEFAULT_REGION must be set."
          exit 1
      fi
-
+
<- snip ->

-When creating assessment type blocks, it's preferable to place each test in its
+When creating assessment type blocks, it's preferable to place each test in its
own block rather than a single block that tests all prerequisites. This approach
will make your TTPs much easier to maintain as they become more complex.

Shaping

-It is often necessary for a TTP to install dependencies, stage files, or shape
+It is often necessary for a TTP to install dependencies, stage files, or shape
the target environment prior to executing the core TTP logic. As with assessment
-type blocks, when creating shaping type blocks, it's preferable to place each
+type blocks, when creating shaping type blocks, it's preferable to place each
action in its own block.

@@ -124,18 +124,18 @@ action in its own block.

#### Execution

-The execution blocks contain the core TTP logic. A single execution block may
+The execution blocks contain the core TTP logic. A single execution block may
be sufficient for simple TTPs such as atomics, which contain a single procedure.
-For complex TTPs, the core logic should be broken up across multiple steps or
-sub-TTPs. In general, if the core logic implements multiple procedures or the
+For complex TTPs, the core logic should be broken up across multiple steps or
+sub-TTPs. In general, if the core logic implements multiple procedures or the
procedure can be reasonably divided, refactoring into smaller steps will enhance
maintainability.

-Code likely to be reused in other TTPs should be placed in a sub-TTP and imported
-where needed. It's easier to maintain building blocks than to modify the same
-(reimplemented) code in multiple places. Good candidates for sub-TTPs include
-assessment and shaping operations. Here, you might check for commonly used
-prerequisites, install frequent tools, or tamper with security controls before
+Code likely to be reused in other TTPs should be placed in a sub-TTP and imported
+where needed. It's easier to maintain building blocks than to modify the same
+(reimplemented) code in multiple places. Good candidates for sub-TTPs include
+assessment and shaping operations. Here, you might check for commonly used
+prerequisites, install frequent tools, or tamper with security controls before
the primary execution block.

```yaml
@@ -148,11 +148,11 @@ steps:

#### Cleanup

-In addition to the implementation logic, each TTP must contain a `cleanup` block
-to revert artifacts from the preceding blocks. If no implementation blocks produce
+In addition to the implementation logic, each TTP must contain a `cleanup` block
+to revert artifacts from the preceding blocks. If no implementation blocks produce
artifacts, the `cleanup` block should just return a success log.

-Example with implementation block artifacts: Here, we revert changes made in
+Example with implementation block artifacts: Here, we revert changes made in
previous steps.
```yaml
steps:
@@ -169,7 +169,7 @@ steps:
        echo "[+] DONE!"

-Example without implementation block artifacts: No changes were made to the
+Example without implementation block artifacts: No changes were made to the
target system. This is reported in the success log.

steps:
@@ -182,4 +182,3 @@ steps:
      inline: |
        echo "No cleanup needed, as this TTP simply dumped clipboard contents to stdout."

, stderr: , err: exit status 1

I'd recommend reinstalling pre-commit on your system. I was running:

pre-commit 3.3.3

@VVX7 VVX7 closed this as completed Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants