-
Notifications
You must be signed in to change notification settings - Fork 29
51 lines (44 loc) · 1.78 KB
/
ansible-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
name: ansible-lint
on: # yamllint disable-line rule:truthy
push:
branches:
- main
- master
pull_request:
jobs:
ansibe-lint:
name: Ansible Lint
runs-on: ubuntu-latest
steps:
# ansible-lint requires the collection to be in a directory in the form
# .../ansible_collections/NAMESPACE/COLLECTION_NAME/
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/redhat/insights
- name: Workaround ansible-lint action bug
run: |
# create a symlink to the .git directory of the checkout
# in the local directory: the current ansible-lint action (v24.6.1)
# prepends "working_directory" to the output location for files in
# the .git directoryof the checkout; regression introduced by
# https://github.com/ansible/ansible-lint/pull/4213
mkdir -p ansible_collections/redhat/insights
ln -s ../../../.git ansible_collections/redhat/insights/
working-directory: ansible_collections/redhat/insights
- name: Set Ansible environment variables (#1)
run: |
echo "ANSIBLE_COLLECTIONS_PATH=$PWD" >> "$GITHUB_ENV"
- name: Set Ansible environment variables (#2)
# yamllint disable rule:line-length
run: |
echo "ANSIBLE_ACTION_PLUGINS=$PWD/plugins/action" >> "$GITHUB_ENV"
echo "ANSIBLE_INVENTORY_PLUGINS=$PWD/plugins/inventory" >> "$GITHUB_ENV"
echo "ANSIBLE_LIBRARY=$PWD/plugins/modules" >> "$GITHUB_ENV"
# yamllint enable rule:line-length
working-directory: ansible_collections/redhat/insights
- name: Run ansible-lint
uses: ansible/ansible-lint@v24
with:
working_directory: ansible_collections/redhat/insights