{"id":16805275,"url":"https://github.com/joshjohanning/organization-readme-badge-generator","last_synced_at":"2025-10-10T17:11:37.548Z","repository":{"id":240971932,"uuid":"803957299","full_name":"joshjohanning/organization-readme-badge-generator","owner":"joshjohanning","description":"An action to generate organization readme badges","archived":false,"fork":false,"pushed_at":"2025-10-07T19:08:16.000Z","size":852,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T20:40:50.171Z","etag":null,"topics":["actions","github","org-readme"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshjohanning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-21T17:25:10.000Z","updated_at":"2025-10-07T19:05:14.000Z","dependencies_parsed_at":"2024-06-28T22:30:19.189Z","dependency_job_id":"c585044a-7f5e-4a3f-97be-1a48b03c7875","html_url":"https://github.com/joshjohanning/organization-readme-badge-generator","commit_stats":null,"previous_names":["joshjohanning/organization-readme-badge-generator"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/joshjohanning/organization-readme-badge-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Forganization-readme-badge-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Forganization-readme-badge-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Forganization-readme-badge-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Forganization-readme-badge-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshjohanning","download_url":"https://codeload.github.com/joshjohanning/organization-readme-badge-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Forganization-readme-badge-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004822,"owners_count":26083784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","github","org-readme"],"created_at":"2024-10-13T09:47:41.658Z","updated_at":"2025-10-10T17:11:37.541Z","avatar_url":"https://github.com/joshjohanning.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# organization-readme-badge-generator\n\n[![Publish GitHub Action](https://github.com/joshjohanning/organization-readme-badge-generator/actions/workflows/publish.yml/badge.svg)](https://github.com/joshjohanning/organization-readme-badge-generator/actions/workflows/publish.yml)\n\nAn action to create markdown badges for your GitHub organization's README.md file using Shields.io.\n\n## Example\n\n\u003c!-- start organization badges --\u003e\n\n\u003e # my-org-name\n\u003e\n\u003e ![Total repositories](https://img.shields.io/static/v1?label=Total%20repositories\u0026message=341\u0026color=blue) ![Open PRs in last 30 days](https://img.shields.io/static/v1?label=Open%20PRs%20in%20last%2030%20days\u0026message=29\u0026color=blue) ![Merged PRs in last 30 days](https://img.shields.io/static/v1?label=Merged%20PRs%20in%20last%2030%20days\u0026message=2\u0026color=blue)\n\n\u003c!-- end organization badges --\u003e\n\n_Live example in my [`joshjohanning-org` org public README](https://github.com/joshjohanning-org#joshjohanning-org)_\n\n## Usage\n\n### Prerequisite\n\nThe action runs and generates an output with the markdown badges. There is a sample script provided that runs after the action to inserts the markdown in between two markers in the `profile/README.md` file ([example](https://github.com/joshjohanning-org/.github/blob/main/profile/README.md?plain=1)) and commit the changes if the file has changed.\n\n```md\n# my-org-name\n\n\u003c!-- start organization badges --\u003e\n\n\u003c!-- end organization badges --\u003e\n```\n\n### Example Workflow\n\n```yml\nname: update-organization-readme-badges\n\non:\n  schedule:\n    - cron: \"0 7 * * *\" # runs daily at 07:00\n  workflow_dispatch:\n\npermissions:\n  contents: write\n\njobs:\n  generate-badges:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: actions/create-github-app-token@v1\n        id: app-token\n        with:\n          app-id: ${{ vars.APP_ID }}\n          private-key: ${{ secrets.PRIVATE_KEY }}\n          owner: ${{ github.repository_owner }}\n\n      - name: organization-readme-badge-generator\n        id: organization-readme-badge-generator\n        uses: joshjohanning/organization-readme-badge-generator@v1\n        with:\n          organization: ${{ github.repository_owner }}\n          token: ${{ steps.app-token.outputs.token }} # recommend to use a GitHub App and not a PAT\n\n      - name: write to job summary\n        run: |\n          echo \"${{ steps.organization-readme-badge-generator.outputs.badges }}\" \u003e\u003e $GITHUB_STEP_SUMMARY\n\n      - name: add to readme\n        run: |\n          readme=profile/README.md\n\n          # get SHA256 before\n          beforeHash=$(sha256sum $readme | awk '{ print $1 }')\n\n          # Define start and end markers\n          startMarker=\"\u003c!-- start organization badges --\u003e\"\n          endMarker=\"\u003c!-- end organization badges --\u003e\"\n\n          replacement=\"${{ steps.organization-readme-badge-generator.outputs.badges }}\"\n\n          # Escape special characters in the replacement text\n          replacementEscaped=$(printf '%s\\n' \"$replacement\" | perl -pe 's/([\\\\\\/\\$\\(\\)@])/\\\\$1/g')\n\n          # Use perl to replace the text between the markers\n          perl -i -pe \"BEGIN{undef $/;} s/\\Q$startMarker\\E.*?\\Q$endMarker\\E/$startMarker\\n$replacementEscaped\\n$endMarker/smg\" $readme\n          # get SHA256 after\n          afterHash=$(sha256sum $readme | awk '{ print $1 }')\n          # Compare the hashes and commit if required\n          if [ \"$afterHash\" = \"$beforeHash\" ]; then\n            echo \"The hashes are equal - exiting script\"\n            exit 0\n          else\n            git config --global user.name 'github-actions[bot]'\n            git config --global user.email 'github-actions[bot]@users.noreply.github.com'\n            git add $readme\n            git commit -m \"docs: update organization readme badges\"\n            git push\n          fi\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshjohanning%2Forganization-readme-badge-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshjohanning%2Forganization-readme-badge-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshjohanning%2Forganization-readme-badge-generator/lists"}