{"id":15022209,"url":"https://github.com/markpatterson27/points-bar","last_synced_at":"2025-10-12T19:49:48.364Z","repository":{"id":37103991,"uuid":"407109364","full_name":"markpatterson27/points-bar","owner":"markpatterson27","description":"A GitHub action that creates an SVG points bar.","archived":false,"fork":false,"pushed_at":"2024-03-01T05:42:50.000Z","size":754,"stargazers_count":7,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-14T21:22:40.598Z","etag":null,"topics":["actions","assessment","autograding","feedback","points"],"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/markpatterson27.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}},"created_at":"2021-09-16T09:48:57.000Z","updated_at":"2024-05-26T06:10:59.126Z","dependencies_parsed_at":"2023-11-18T15:05:31.683Z","dependency_job_id":"75ef9807-641b-4dff-b04b-294f98d15e2f","html_url":"https://github.com/markpatterson27/points-bar","commit_stats":{"total_commits":84,"total_committers":2,"mean_commits":42.0,"dds":0.1071428571428571,"last_synced_commit":"7aef25ca87b5e01cc36a4209ee483b435ae4648a"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpatterson27%2Fpoints-bar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpatterson27%2Fpoints-bar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpatterson27%2Fpoints-bar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpatterson27%2Fpoints-bar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markpatterson27","download_url":"https://codeload.github.com/markpatterson27/points-bar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525139,"owners_count":21118620,"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","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","assessment","autograding","feedback","points"],"created_at":"2024-09-24T19:57:38.731Z","updated_at":"2025-10-12T19:49:43.324Z","avatar_url":"https://github.com/markpatterson27.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Points Bar Action\n\n[![units-test](https://github.com/markpatterson27/points-bar/actions/workflows/test.yml/badge.svg)](https://github.com/markpatterson27/points-bar/actions/workflows/test.yml)\n\nA GitHub action that creates an SVG points bar.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"points bar\" height=\"36\" src=\"../../blob/svg-build/.github/icons/points-bar.svg\" /\u003e\n    \u003cbr /\u003e\n    \u003cimg alt=\"points badge\" height=\"20\" src=\"../../blob/svg-build/.github/icons/points-badge.svg\" /\u003e \u003cimg alt=\"points badge reversed\" height=\"20\" src=\"../../blob/svg-build/.github/icons/points-badge-reversed.svg\" /\u003e\n\u003c/p\u003e\n\n## Usage\n\n```yaml\nname: Update Points Bar\n\non:\n  push:\n\njobs:\n  update:\n    name: Update points bar\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      # create points bar\n      - name: points bar\n        uses: markpatterson27/points-bar@v1\n        with:\n          points: '25/50'\n          path: 'points-bar.svg'\n\n      # commit and push points-bar if changed\n      - name: Commit changes\n        run: |\n          git config --local user.email \"action@github.com\"\n          git config --local user.name \"GitHub Action\"\n          git add 'points-bar.svg'\n          git commit -m \"Add/Update points bar\" || exit 0\n          git push\n\n```\n\n## Inputs\n\n| Input Name | Required | Default | Description |\n|---|---|---|---|\n| `points` | yes |  | Points string separated with a / slash. |\n| `path` | yes |  | File path to save the generated SVG to. |\n| `type` | no | 'default' | Style of bar to generate. Can be either 'default' or 'badge'. |\n| `bar-color` | no |  | Color to use for the points bar. |\n| `bar-background` | no |  | Background color for the points bar. |\n| `font-color` | no |  | Color to use for text. |\n| `label` | no | 'Points' | Text to use for label part of points bar. |\n| `width` | no |  | Bar/badge width. |\n| `reverse` | no | 'false' | Reverse the progress direction of the bar. i.e. Progress bar moves from right to left. |\n\n## Examples\n\n### Default\n\n\u003cimg alt=\"points bar\" height=\"36\" src=\"../../blob/svg-build/.github/icons/points-bar.svg\" /\u003e\n\n```yaml\n- name: points bar\n  uses: markpatterson27/points-bar@v1\n  with:\n    points: '25/50'\n    path: '.github/icons/points-bar.svg'\n```\n\n### Badge\n\n\u003cimg alt=\"points badge\" height=\"20\" src=\"../../blob/svg-build/.github/icons/points-badge.svg\" /\u003e\n\n```yaml\n- name: points badge\n  uses: markpatterson27/points-bar@v1\n  with:\n    points: '25/50'\n    path: '.github/icons/points-badge.svg'\n    type: 'badge'\n```\n\n### Text and Bar Color\n\n\u003cimg alt=\"points bar color\" height=\"36\" src=\"../../blob/svg-build/.github/icons/points-bar-color.svg\" /\u003e\n\n```yaml\n- name: points bar color\n  uses: markpatterson27/points-bar@v1\n  with:\n    points: '25/50'\n    path: '.github/icons/points-bar-color.svg'\n    bar-color: 'gold'\n    bar-background: '#115544'\n    font-color: '#BF5700'\n```\n\n### Label\n\n\u003cimg alt=\"points bar custom label\" height=\"36\" src=\"../../blob/svg-build/.github/icons/points-bar-custom-label.svg\" /\u003e\n\n```yaml\n- name: points bar\n  uses: markpatterson27/points-bar@v1\n  with:\n    points: '25/50'\n    path: '.github/icons/points-bar-custom-label.svg'\n    label: 'Score'\n```\n\n\u003cimg alt=\"points badge custom label\" height=\"20\" src=\"../../blob/svg-build/.github/icons/points-badge-custom-label.svg\" /\u003e\n\n```yaml\n- name: autograde badge\n  uses: markpatterson27/points-bar@v1\n  with:\n    points: '25/50'\n    path: '.github/icons/points-badge-custom-label.svg'\n    type: 'badge'\n    label: 'Autograde'\n```\n\n### Width\n\n\u003cimg alt=\"points bar wide\" height=\"36\" src=\"../../blob/svg-build/.github/icons/points-bar-wide.svg\" /\u003e\n\n```yaml\n- name: points bar\n  uses: markpatterson27/points-bar@v1\n  with:\n    points: '25/50'\n    path: '.github/icons/points-bar-wide.svg'\n    width: 220\n```\n\n### Reversed\n\n\u003cimg alt=\"points badge reversed\" height=\"20\" src=\"../../blob/svg-build/.github/icons/points-badge-reversed.svg\" /\u003e\n\n```yaml\n- name: points badge reversed\n  uses: markpatterson27/points-bar@v1\n  with:\n    points: '25/50'\n    path: '.github/icons/points-badge-reversed.svg'\n    type: 'badge'\n    bar-color: '#11BBCC'\n    bar-background: '#88BBCC'\n    reverse: true\n```\n\n## GitHub Classroom Use\n\nThe points bar was original written to be used with GitHub Classroom's autograding feature to provide grade score feedback to students. To use the points bar with GitHub Classroom, replace (or edit) the `.github/workflow/classroom.yml` workflow file used by Autograding with the following:\n\n```yaml\nname: GitHub Classroom Workflow\n\non: \n  push:\n    branches:\n    - '*'\n    - '!badges'\n\njobs:\n  build:\n    name: Autograding\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          fetch-depth: 0 # otherwise, you will failed to push refs to dest repo\n\n      # add id to action so outputs can be used\n      - uses: education/autograding@v1\n        id: autograder\n        continue-on-error: true\n\n      # switch to badges branch\n      - run: git checkout badges || git checkout -b badges\n\n      # create points bar\n      - name: points bar\n        uses: markpatterson27/points-bar@v1\n        with:\n          points: ${{ steps.autograder.outputs.points }}\n          path: '.github/badges/points-bar.svg'\n\n      # commit and push badges if badges have changed\n      - name: Commit changes to points bar\n        run: |\n          git config --local user.email \"action@github.com\"\n          git config --local user.name \"GitHub Action\"\n          git add '.github/badges/points-bar.svg'\n          git commit -m \"Add/Update points bar\" || exit 0\n          git push origin badges\n```\n\nTo display the points bar, add the following to the top of the assignment README:\n\n```\n![Points bar](../../blob/badges/.github/badges/points-bar.svg)\n```\n\nIf you want to float the points bar to the right, use the following instead:\n\n```html\n\u003cimg alt=\"points bar\" align=\"right\" height=\"36\" src=\"../../blob/status/.github/badges/points-bar.svg\" /\u003e\n```\n\n## Using the Reusable Points Bar Workflow\n\nThis repository includes a [reusable workflow](https://docs.github.com/en/actions/using-workflows/reusing-workflows) for generating a points bar. The workflow includes steps to commit and push the updated points bar back to the repository.\n\nAn example of how to use the reusable workflow:\n\n```yaml\nname: My Workflow\non:\n  push:\n    branches:\n    - '*'\n    - '!status'\n\njobs:\n  update-points-bar:\n    uses: markpatterson27/points-bar/.github/workflows/reusable-workflow.yml@main\n    permissions:\n      contents: write\n    with:\n      points: '10/20'\n      path: '.github/activity-icons/points-bar.svg'\n      type: 'bar'\n      bar-color: '#4c1'\n      bar-background: '#555'\n      font-color: '#aaa'\n      label: 'Points'\n      width: '100'\n      reverse: false\n      branch: status\n    secrets:\n      token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nInputs for the reusable workflow follow the action inputs described above with the following additional inputs:\n\n| Input Name | Required | Default | Description |\n|---|---|---|---|\n| `branch` | yes | 'main' | Name of branch to commit the points bar to. |\n| `token` | yes |  | Token with permissions to commit and push updated points bar back to the repository. |\n\n## Alternatives\n\n[Badge Action](https://github.com/emibcn/badge-action) creates a customizable badge with many styling options. Useful if you want a customizable badge and don't need a progress style points bar.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkpatterson27%2Fpoints-bar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkpatterson27%2Fpoints-bar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkpatterson27%2Fpoints-bar/lists"}