Skip to content

Commit

Permalink
chore: allow git rev-parse to be used
Browse files Browse the repository at this point in the history
If a user wants to call `git rev-parse`, allow this without
raising a `command-instead-of-module` error.

One use would be to do: `git rev-parse HEAD` which will get the SHA
value of the current HEAD of the git repository.

The `ansible.builtin.git` module does not have support for doing this.
  • Loading branch information
JohnVillalovos authored and audgirka committed Jul 17, 2023
1 parent 0cea5b6 commit 908b86a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/command_instead_of_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CommandsInsteadOfModulesRule(AnsibleLintRule):
}

_executable_options = {
"git": ["branch", "log", "lfs"],
"git": ["branch", "log", "lfs", "rev-parse"],
"systemctl": ["--version", "kill", "set-default", "show-environment", "status"],
"yum": ["clean"],
"rpm": ["--nodeps"],
Expand Down

0 comments on commit 908b86a

Please sign in to comment.