-
Notifications
You must be signed in to change notification settings - Fork 663
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
GitHub Action: properly respect the working_directory
argument
#3905
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This way the working directory passed as argument is available to all the steps, not only the ansible-lint one. Signed-off-by: Pino Toscano <[email protected]>
Make sure to respect the working directory when running the shell steps and locating the files that are supposed to be in the working directory. Signed-off-by: Pino Toscano <[email protected]>
ptoscano
requested review from
a team,
cristianonicolai and
priyamsahoo
and removed request for
a team
November 21, 2023 13:26
ptoscano
added a commit
to RedHatInsights/ansible-collections-insights
that referenced
this pull request
Nov 23, 2023
Add a simple workflow to run ansible-lint on push and for pull requests. ansible-lint requires a "ansible_collections/<namespace>/<name>/" structure to recognize the collection and its bits, so check out the code in that way. Also export few environment variables to locate all the bits. Sadly currently (ansible-lint v6.22.0) the action does not respect its "working_directory" for all the steps, failing in its initial setup steps; a potential fix has been proposed [1], so create a local workaround to get the action to run in the meanwhile. [1] ansible/ansible-lint#3905 Signed-off-by: Pino Toscano <[email protected]>
ptoscano
added a commit
to RedHatInsights/ansible-collections-insights
that referenced
this pull request
Nov 27, 2023
Add a simple workflow to run ansible-lint on push and for pull requests. ansible-lint requires a "ansible_collections/<namespace>/<name>/" structure to recognize the collection and its bits, so check out the code in that way. Also export few environment variables to locate all the bits. Sadly currently (ansible-lint v6.22.0) the action does not respect its "working_directory" for all the steps, failing in its initial setup steps; a potential fix has been proposed [1], so create a local workaround to get the action to run in the meanwhile. [1] ansible/ansible-lint#3905 Signed-off-by: Pino Toscano <[email protected]>
ssbarnea
approved these changes
Nov 27, 2023
ptoscano
added a commit
to RedHatInsights/ansible-collections-insights
that referenced
this pull request
Nov 30, 2023
There was a bug [1] in the ansible-lint action that made its "working_directory" parameter not working as expected. This was fixed in v6.22.1 [2]. Since we use the "v6" tag, which points to the latest version of ansible-lint 6.x, the fixed action should be used already. Hence, drop the workaround step. [1] ansible/ansible-lint#3905 [2] https://github.com/ansible/ansible-lint/releases/tag/v6.22.1 Signed-off-by: Pino Toscano <[email protected]>
ahitacat
pushed a commit
to RedHatInsights/ansible-collections-insights
that referenced
this pull request
Nov 30, 2023
There was a bug [1] in the ansible-lint action that made its "working_directory" parameter not working as expected. This was fixed in v6.22.1 [2]. Since we use the "v6" tag, which points to the latest version of ansible-lint 6.x, the fixed action should be used already. Hence, drop the workaround step. [1] ansible/ansible-lint#3905 [2] https://github.com/ansible/ansible-lint/releases/tag/v6.22.1 Signed-off-by: Pino Toscano <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #3798 introduced a
working_directory
argument to switch the base directory in whichansible-lint
runs; while it seems a good idea, in practice it does not work properly.When specifying a different working directory than
github.workspace
, the steps before theansible-lint
run are not run in that different directory, leading towget
andpip
to fail because of.git
not found.Hence: