Skip to content

Commit

Permalink
Fix ansible#3938: don't assume working_directory is github.workspace
Browse files Browse the repository at this point in the history
Setting `working_directory` for ansible-lint action would fail due to
hard-coded `.git`, introduced in commit 6f728e0, when fetching
`.config/requirements-lock.txt`.

This fix replaces `.git` with `${{ github.workspace }}/.git` to make
`working_directory` argument work again.
  • Loading branch information
ajfabbri committed Apr 9, 2024
1 parent 88c5bd7 commit d58ce1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d58ce1c

Please sign in to comment.