Skip to content

Commit d7c9bff

Browse files
Fix use of versioned github action (#3762)
Co-authored-by: Sorin Sbarnea <[email protected]>
1 parent 74c041b commit d7c9bff

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ runs:
3838
# https://github.com/actions/setup-python/issues/361
3939
- name: Generate .git/ansible-lint-requirements.txt
4040
shell: bash
41+
env:
42+
GH_ACTION_REF: ${{ github.action_ref || 'main' }}
4143
working-directory: ${{ steps.inputs.outputs.working_directory }}
4244
run: |
43-
wget --output-document=.git/ansible-lint-requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/${{ github.action_ref || 'main' }}/.config/requirements-lock.txt
45+
wget --output-document=.git/ansible-lint-requirements.txt https://raw.githubusercontent.com/ansible/ansible-lint/$GH_ACTION_REF/.config/requirements-lock.txt
4446
4547
- name: Set up Python
4648
if: inputs.setup_python == 'true'
@@ -52,13 +54,15 @@ runs:
5254

5355
- name: Install ansible-lint
5456
shell: bash
57+
env:
58+
GH_ACTION_REF: ${{ github.action_ref || 'main' }}
5559
# We need to set the version manually because $GITHUB_ACTION_PATH is not
5660
# a git clone and setuptools-scm would not be able to determine the version.
5761
# git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}
5862
# SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.action_ref || 'main' }}
5963
run: |
6064
cd $GITHUB_ACTION_PATH
61-
pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@${{ github.action_ref || 'main' }}"
65+
pip install "ansible-lint[lock] @ git+https://github.com/ansible/ansible-lint@$GH_ACTION_REF"
6266
ansible-lint --version
6367
6468
- name: Run ansible-lint

0 commit comments

Comments
 (0)