Skip to content

Commit 8502a94

Browse files
committed
ci: log collection commit SHAs for debugging
1 parent 5045e84 commit 8502a94

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.tasks/ansible.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ tasks:
1313
- :ensure-collections-dir
1414
cmds:
1515
- ansible-galaxy collection install -r {{.USER_WORKING_DIR}}/requirements.yml --force -p {{.ANSIBLE_COLLECTIONS_PATH}}
16+
- |
17+
# Log git-based collection commit SHAs for debugging
18+
for collection_dir in {{.ANSIBLE_COLLECTIONS_PATH}}/ansible_collections/*/*; do
19+
if [ -d "$collection_dir/.git" ]; then
20+
collection_name=$(basename $(dirname $collection_dir))/$(basename $collection_dir)
21+
commit_sha=$(git -C "$collection_dir" rev-parse HEAD 2>/dev/null)
22+
commit_msg=$(git -C "$collection_dir" log -1 --format="%s" 2>/dev/null)
23+
echo "Collection $collection_name at commit: $commit_sha ($commit_msg)"
24+
fi
25+
done
1626
1727
role:
1828
desc: Install Ansible roles

0 commit comments

Comments
 (0)