Skip to content

Commit

Permalink
Fix use of versioned github action (#3762)
Browse files Browse the repository at this point in the history
Co-authored-by: Sorin Sbarnea <[email protected]>
  • Loading branch information
karl-johan-grahn and ssbarnea authored Nov 28, 2023
1 parent 74c041b commit d7c9bff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ runs:
# https://github.com/actions/setup-python/issues/361
- name: Generate .git/ansible-lint-requirements.txt
shell: bash
env:
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/${{ github.action_ref || 'main' }}/.config/requirements-lock.txt
wget --output-document=.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'
Expand All @@ -52,13 +54,15 @@ runs:

- name: Install ansible-lint
shell: bash
env:
GH_ACTION_REF: ${{ github.action_ref || 'main' }}
# We need to set the version manually because $GITHUB_ACTION_PATH is not
# a git clone and setuptools-scm would not be able to determine the version.
# git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}
# SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.action_ref || 'main' }}
run: |
cd $GITHUB_ACTION_PATH
pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}"
pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@$GH_ACTION_REF"
ansible-lint --version
- name: Run ansible-lint
Expand Down

0 comments on commit d7c9bff

Please sign in to comment.