You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a regression of the fix in #4103, which was undone by #4213. As a result, this problem has resurfaced in the same use case that the original fix was meant to resolve.
For clarification this affects all users who are setting the working_directory input to a path other than the root of a repository (i.e. a path containing a .git directory). For such users, it is breaking!
Given that the user is allowed to define an arbitrary working directory, assuming the existence of .git within the set path seems (and is proving to be) very fragile.
Requirements file is downloaded to a path that exists, whether pre-existing or created at runtime.
Actual Behavior
It seems that the action assumes there will be a .git directory, which isn't necessarily the case if using anything other than the repository root as the working directory (such as shown in the example above).
2024-09-10T11:18:27.0870375Z ##[group]Run wget --output-document=ansible/.git/ansible-lint-requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/$GH_ACTION_REF/.config/requirements-lock.txt
2024-09-10T11:18:27.0872062Z �[36;1mwget --output-document=ansible/.git/ansible-lint-requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/$GH_ACTION_REF/.config/requirements-lock.txt�[0m
2024-09-10T11:18:27.0895305Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2024-09-10T11:18:27.0895919Z env:
2024-09-10T11:18:27.0896190Z ANSIBLE_DIR: ansible
2024-09-10T11:18:27.0896543Z GH_ACTION_REF: main
2024-09-10T11:18:27.0896976Z ##[endgroup]
2024-09-10T11:18:27.0982808Z ansible/.git/ansible-lint-requirements.txt: No such file or directory
2024-09-10T11:18:27.0998516Z ##[error]Process completed with exit code 1.
The text was updated successfully, but these errors were encountered:
tigattack
changed the title
Regression - github action fails to download ansible-lint-requirements.txt when working directory is not repo root
Regression - GH action fails to download requirements if .git directory missing in work dir
Sep 11, 2024
Summary
Relates to #3938
This is a regression of the fix in #4103, which was undone by #4213. As a result, this problem has resurfaced in the same use case that the original fix was meant to resolve.
For clarification this affects all users who are setting the
working_directory
input to a path other than the root of a repository (i.e. a path containing a.git
directory). For such users, it is breaking!Since https://github.com/ansible/ansible-lint/blob/main/action.yml#L49 explicitly references
${{ steps.inputs.outputs.working_directory }}/.git
, the action simply fails as soon as it reaches this point when a.git
directory does not exist in the current path.Given that the user is allowed to define an arbitrary working directory, assuming the existence of
.git
within the set path seems (and is proving to be) very fragile.Issue Type
OS / ENVIRONMENT
github actions
STEPS TO REPRODUCE
ansible-lint workflow:
Desired Behavior
Requirements file is downloaded to a path that exists, whether pre-existing or created at runtime.
Actual Behavior
It seems that the action assumes there will be a
.git
directory, which isn't necessarily the case if using anything other than the repository root as the working directory (such as shown in the example above).The text was updated successfully, but these errors were encountered: