Skip to content

Commit

Permalink
Update script
Browse files Browse the repository at this point in the history
  • Loading branch information
avidit committed Mar 14, 2024
1 parent a4659b4 commit 5ee99e4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
File renamed without changes.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@

Workflow | Status
---------|--------
[build.yml](https://github.com/DynamoDS/actions-dashboard/actions/workflows/build.yml) | [![build.yml](https://github.com/DynamoDS/actions-dashboard/actions/workflows/build.yml/badge.svg)](https://github.com/DynamoDS/actions-dashboard/actions/workflows/build.yml)

## [DynamoDS/DynamoRevit](https://github.com/DynamoDS/DynamoRevit)

Workflow | Status
---------|--------
[label_issues.yml](https://github.com/DynamoDS/DynamoRevit/actions/workflows/label_issues.yml) | [![label_issues.yml](https://github.com/DynamoDS/DynamoRevit/actions/workflows/label_issues.yml/badge.svg)](https://github.com/DynamoDS/DynamoRevit/actions/workflows/label_issues.yml)
[move_issues.yml](https://github.com/DynamoDS/DynamoRevit/actions/workflows/move_issues.yml) | [![move_issues.yml](https://github.com/DynamoDS/DynamoRevit/actions/workflows/move_issues.yml/badge.svg)](https://github.com/DynamoDS/DynamoRevit/actions/workflows/move_issues.yml)
[gh_pages.yml](https://github.com/DynamoDS/actions-dashboard/actions/workflows/gh_pages.yml) | [![gh_pages.yml](https://github.com/DynamoDS/actions-dashboard/actions/workflows/gh_pages.yml/badge.svg)](https://github.com/DynamoDS/actions-dashboard/actions/workflows/gh_pages.yml)

## [DynamoDS/Dynamo](https://github.com/DynamoDS/Dynamo)

Expand All @@ -33,6 +26,13 @@ Workflow | Status
[move_issue.yml](https://github.com/DynamoDS/Dynamo/actions/workflows/move_issue.yml) | [![move_issue.yml](https://github.com/DynamoDS/Dynamo/actions/workflows/move_issue.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/move_issue.yml)
[ui_smoke_tests.yml](https://github.com/DynamoDS/Dynamo/actions/workflows/ui_smoke_tests.yml) | [![ui_smoke_tests.yml](https://github.com/DynamoDS/Dynamo/actions/workflows/ui_smoke_tests.yml/badge.svg)](https://github.com/DynamoDS/Dynamo/actions/workflows/ui_smoke_tests.yml)

## [DynamoDS/DynamoRevit](https://github.com/DynamoDS/DynamoRevit)

Workflow | Status
---------|--------
[label_issues.yml](https://github.com/DynamoDS/DynamoRevit/actions/workflows/label_issues.yml) | [![label_issues.yml](https://github.com/DynamoDS/DynamoRevit/actions/workflows/label_issues.yml/badge.svg)](https://github.com/DynamoDS/DynamoRevit/actions/workflows/label_issues.yml)
[move_issues.yml](https://github.com/DynamoDS/DynamoRevit/actions/workflows/move_issues.yml) | [![move_issues.yml](https://github.com/DynamoDS/DynamoRevit/actions/workflows/move_issues.yml/badge.svg)](https://github.com/DynamoDS/DynamoRevit/actions/workflows/move_issues.yml)

## [DynamoDS/workflows](https://github.com/DynamoDS/workflows)

Workflow | Status
Expand Down
29 changes: 15 additions & 14 deletions generate_readme.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash

# This script generates the README.md file.
# it requires gh to be installed. https://cli.github.com/
# It requires gh to be installed and configured.
# https://cli.github.com/
#
# Usage: ./generate_readme.sh

Expand All @@ -20,34 +21,34 @@ list_repos() {
--limit 100 \
--no-archived \
--visibility public \
--json nameWithOwner \
--template '{{range .}}{{.nameWithOwner}}{{"\n"}}{{end}}'
--json nameWithOwner,url \
--template '{{range .}}{{.nameWithOwner}}{{","}}{{.url}}{{"\n"}}{{end}}'
}

echo "# Workflows" > ${output_file}
echo "" >> ${output_file}
echo "# Workflows" > $output_file
echo "" >> $output_file

echo "🔍 Getting all repositories"
repos=$(list_repos $org)
for repo in $repos; do
list_repos $org | while IFS=, read -r repo url; do
echo
echo "ℹ️ Parsing repository: $repo"
workflows=$(gh api /repos/$repo/contents/.github/workflows -q '.[] | select(.type == "file") | .name')
if [ $? -ne 0 ]; then
continue
fi

echo "## [$repo](https://github.com/$repo)" >> ${output_file}
echo "" >> ${output_file}
echo "Workflow | Status" >> ${output_file}
echo "---------|--------" >> ${output_file}
echo "## [$repo]($url)" >> $output_file
echo "" >> $output_file
echo "Workflow | Status" >> $output_file
echo "---------|--------" >> $output_file

for workflow in $workflows; do
echo "ℹ️ Parsing workflow: $workflow"
echo "🔹 $workflow"
path="https://github.com/$repo/actions/workflows/$workflow"
badge="https://github.com/$repo/actions/workflows/$workflow/badge.svg"
echo "[$workflow]($path) | [![$workflow]($badge)]($path)" >> ${output_file}
echo "[$workflow]($path) | [![$workflow]($badge)]($path)" >> $output_file
done
echo "" >> ${output_file}
echo "" >> $output_file
done

echo
Expand Down

0 comments on commit 5ee99e4

Please sign in to comment.