From d58ce1c6be87aeac5c4397484b9488b6c697058c Mon Sep 17 00:00:00 2001 From: Aaron Fabbri Date: Tue, 9 Apr 2024 11:50:31 -0700 Subject: [PATCH] Fix #3938: don't assume working_directory is github.workspace Setting `working_directory` for ansible-lint action would fail due to hard-coded `.git`, introduced in commit 6f728e0c, when fetching `.config/requirements-lock.txt`. This fix replaces `.git` with `${{ github.workspace }}/.git` to make `working_directory` argument work again. --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 90e61d77e2..8ec9ea242c 100644 --- a/action.yml +++ b/action.yml @@ -42,14 +42,14 @@ runs: GH_ACTION_REF: ${{ github.action_ref || 'main' }} working-directory: ${{ steps.inputs.outputs.working_directory }} run: | - wget --output-document=.git/ansible-lint-requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/$GH_ACTION_REF/.config/requirements-lock.txt + wget --output-document=${{ github.workspace}}/.git/ansible-lint-requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/$GH_ACTION_REF/.config/requirements-lock.txt - name: Set up Python if: inputs.setup_python == 'true' uses: actions/setup-python@v5 with: cache: pip - cache-dependency-path: ${{ steps.inputs.outputs.working_directory }}/.git/ansible-lint-requirements.txt + cache-dependency-path: ${{ github.workspace }}/.git/ansible-lint-requirements.txt python-version: "3.11" - name: Install ansible-lint