@@ -28,56 +28,63 @@ jobs:
2828 OUT_DIR=output/badges/${{ inputs.repo_name }}
2929
3030 # Release branch badge
31- default_branch=$(gh repo view ansible-lockdown/ ${{ inputs.repo_name }} --json defaultBranchRef --jq '.defaultBranchRef.name')
31+ default_branch=$(gh repo view " ${{ inputs.repo_name }}" --json defaultBranchRef --jq '.defaultBranchRef.name')
3232 echo '{ "schemaVersion": 1, "label": "Release Branch", "message": "'"$default_branch"'", "color": "brightgreen" }' > $OUT_DIR/release-branch.json
3333
3434 # Remediate pipeline badge
35- status=$(gh run list -R ansible-lockdown/ ${{ inputs.repo_name }} --workflow="main_pipeline_validation.yml" --json status,conclusion --jq '.[0] | .status + ":" + .conclusion' || echo "unknown:unknown")
35+ status=$(gh run list -R " ${{ inputs.repo_name }}" --workflow="main_pipeline_validation.yml" --json status,conclusion --jq '.[0] | .status + ":" + .conclusion' || echo "unknown:unknown")
3636 if [[ "$status" == "completed:success" ]]; then
3737 color=green; msg=Passing
3838 elif [[ "$status" == "completed:failure" ]]; then
3939 color=red; msg=Failing
4040 else
4141 color=lightgrey; msg=Unknown
4242 fi
43- echo '{ "schemaVersion": 1, "label": "Remediate Pipeline", "message": "'"$msg"'", "color": "brightgreen" }' > $OUT_DIR/remediate.json
43+ echo '{ "schemaVersion": 1, "label": "Remediate Pipeline", "message": "'"$msg"'", "color": "color": " brightgreen" }' > $OUT_DIR/remediate.json
4444
4545 # GPO pipeline badge
46- status=$(gh run list -R ansible-lockdown/ ${{ inputs.repo_name }} --workflow="main_pipeline_validation_gpo.yml" --json status,conclusion --jq '.[0] | .status + ":" + .conclusion' || echo "unknown:unknown")
46+ status=$(gh run list -R " ${{ inputs.repo_name }}" --workflow="main_pipeline_validation_gpo.yml" --json status,conclusion --jq '.[0] | .status + ":" + .conclusion' || echo "unknown:unknown")
4747 if [[ "$status" == "completed:success" ]]; then
4848 color=green; msg=Passing
4949 elif [[ "$status" == "completed:failure" ]]; then
5050 color=red; msg=Failing
5151 else
5252 color=lightgrey; msg=Unknown
5353 fi
54- echo '{ "schemaVersion": 1, "label": "GPO Pipeline", "message": "'"$msg"'", "color": "brightgreen" }' > $OUT_DIR/gpo.json
54+ echo '{ "schemaVersion": 1, "label": "GPO Pipeline", "message": "'"$msg"'", "color": "color": " brightgreen" }' > $OUT_DIR/gpo.json
5555
5656 # Pull requests
57- prs=$(gh pr list -R ansible-lockdown/ ${{ inputs.repo_name }} --json number --jq 'length')
57+ prs=$(gh pr list -R " ${{ inputs.repo_name }}" --json number --jq 'length')
5858 echo '{ "schemaVersion": 1, "label": "Pull Requests", "message": "'"$prs"'", "color": "blue" }' > $OUT_DIR/prs.json
5959
6060 # Closed issues
61- closed=$(gh issue list -R ansible-lockdown/ ${{ inputs.repo_name }} --state closed --json number --jq 'length')
61+ closed=$(gh issue list -R " ${{ inputs.repo_name }}" --state closed --json number --jq 'length')
6262 echo '{ "schemaVersion": 1, "label": "Closed Issues", "message": "'"$closed"'", "color": "success" }' > $OUT_DIR/issues-closed.json
6363
6464 # Benchmark version badge
6565 echo "Cloning latest branch of ${{ inputs.repo_name }} to extract version..."
66- git clone --depth 1 --branch latest https://x-access-token:${{ secrets.BADGE_PUSH_TOKEN }}@github.com/ansible-lockdown/${{ inputs.repo_name }}.git tmp_repo
67- cd tmp_repo
68-
69- version=$(grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+' README.md | head -n1)
70- if [ -z "$version" ]; then
71- version=$(grep -Eo 'Version [0-9]+, Rel [0-9]+' README.md | head -n1)
72- fi
73- cd ..
74-
75- if [ -z "$version" ]; then
66+ git clone --depth 1 --branch latest https://x-access-token:${{ secrets.BADGE_PUSH_TOKEN }}@github.com/${{ inputs.repo_name }}.git tmp_repo
67+ if [ ! -f tmp_repo/README.md ]; then
7668 version="Unknown"
69+ echo "README.md not found"
70+ else
71+ cd tmp_repo
72+ version=$(grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+' README.md | head -n1)
73+ if [ -z "$version" ]; then
74+ version=$(grep -Eo 'Version [0-9]+, Rel [0-9]+' README.md | head -n1)
75+ fi
76+ cd ..
7777 fi
78+ rm -rf tmp_repo
79+
80+ if [ -z "$version" ]; then version="Unknown"; fi
7881
7982 echo "Extracted Benchmark Version: $version"
80- echo '{ "schemaVersion": 1, "label": "Benchmark Version", "message": "'"$version"'", "color": "orange" }' > $OUT_DIR/benchmark-version.json
83+ echo '{ "schemaVersion": 1, "label": "Benchmark Version", "message": "'"$version"'", "color": "blue" }' > $OUT_DIR/benchmark-version.json
84+
85+ # Last updated badge
86+ date_str=$(date -u +"%Y-%m-%dT%H:%MZ")
87+ echo '{ "schemaVersion": 1, "label": "Last Updated", "message": "'"$date_str"'", "color": "blue" }' > $OUT_DIR/last-updated.json
8188
8289 - name : Add .nojekyll to prevent GitHub Pages filtering
8390 run : touch output/.nojekyll
0 commit comments