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

Change directory when checking ignored files #4933

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Conversation

ferrarimarco
Copy link
Collaborator

@ferrarimarco ferrarimarco commented Dec 4, 2023

Proposed Changes

  1. Change the working directory to the workspace when checking files that should be ignored by Git

Readiness Checklist

Author/Contributor

  • I included all the needed documentation for this change.
  • I provided the necessary tests.

Reviewing Maintainer

  • Label as breaking if this is a large, fundamental change.
  • Label as either: automation, bug, documentation, enhancement, infrastructure.

BEGIN_COMMIT_OVERRIDE
fix: change directory when checking ignored files (#4933)
END_COMMIT_OVERRIDE

@ferrarimarco ferrarimarco added the bug Something isn't working label Dec 4, 2023
@ferrarimarco ferrarimarco self-assigned this Dec 4, 2023
@ferrarimarco ferrarimarco added the O: backlog 🤖 Backlog, stale ignores this label label Dec 5, 2023
Copy link
Contributor

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ferrarimarco ferrarimarco added this pull request to the merge queue Dec 6, 2023
Merged via the queue into main with commit eb688a0 Dec 6, 2023
3 checks passed
@ferrarimarco ferrarimarco deleted the change-dir-gitignore branch December 6, 2023 07:54
@kftsehk
Copy link
Contributor

kftsehk commented Dec 6, 2023

FYI, this issue seems already covered by #4821, which had pushd ${GITHUB_WORKSPACE} very early, right after knowing what ${GITHUB_WORKSPACE} is.

After this point, the working directory is at ${GITHUB_WORKSPACE} unless somewhere in the code popd it for a reason.

super-linter/lib/linter.sh

Lines 491 to 501 in f3c1589

if [ -z "${GITHUB_WORKSPACE}" ]; then
GITHUB_WORKSPACE="${DEFAULT_WORKSPACE}"
fi
if [ ! -d "${GITHUB_WORKSPACE}" ]; then
fatal "Provided volume is not a directory!"
fi
info "Linting all files in mapped directory:[${GITHUB_WORKSPACE}]"
pushd "${GITHUB_WORKSPACE}" >/dev/null || exit 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working O: backlog 🤖 Backlog, stale ignores this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants