{"id":15286390,"url":"https://github.com/polygenelubricants/repository-insight-tracker","last_synced_at":"2025-10-25T22:33:23.224Z","repository":{"id":255590956,"uuid":"849867901","full_name":"PolygeneLubricants/repository-insight-tracker","owner":"PolygeneLubricants","description":"GitHub action to read repository insights daily and store these in a file. This enables more than 14 days of insights.","archived":false,"fork":false,"pushed_at":"2025-06-12T00:15:39.000Z","size":681,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T01:27:46.254Z","etag":null,"topics":["github-action","github-actions","insights","javascript","traffic-stats","view-count"],"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/PolygeneLubricants.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-08-30T12:11:50.000Z","updated_at":"2025-03-24T18:21:57.000Z","dependencies_parsed_at":"2024-09-14T14:04:54.430Z","dependency_job_id":"aba4f38e-2911-4fb6-85ab-43f652739b4d","html_url":"https://github.com/PolygeneLubricants/repository-insight-tracker","commit_stats":null,"previous_names":["polygenelubricants/repository-insight-tracker"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/PolygeneLubricants/repository-insight-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Frepository-insight-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Frepository-insight-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Frepository-insight-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Frepository-insight-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolygeneLubricants","download_url":"https://codeload.github.com/PolygeneLubricants/repository-insight-tracker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Frepository-insight-tracker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259398712,"owners_count":22851486,"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":["github-action","github-actions","insights","javascript","traffic-stats","view-count"],"created_at":"2024-09-30T15:13:37.486Z","updated_at":"2025-10-25T22:33:18.186Z","avatar_url":"https://github.com/PolygeneLubricants.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github Action: Repository Insight Tracker\n\nThis GitHub Action updates the repository statistics including the number of stargazers, commits, contributors, traffic views, and clones. \nThe results are stored in a JSON or CSV file and committed to a specified branch in the repository.\n\n1. Collects statistics on stargazers, commits, contributors, traffic views, and clones using the Github Rest API and GraphQL API.\n2. Writes the statistics to a JSON or CSV file under `\u003cdirectory\u003e/\u003cowner\u003e/\u003crepository\u003e/stats.\u003cformat\u003e`.\n3. Commits the file to a specified branch in the repository.\n4. Pipes the data as output to the next action, for further processing.\n\n## Inputs\n\n| Input Name    | Description                                                      | Required | Default                       |\n| ------------- | ---------------------------------------------------------------- | -------- | ----------------------------- |\n| `github-token`| GitHub token to authenticate the action.                         | Yes      | `${{ secrets.GITHUB_TOKEN }}` |\n| `owner`       | The organization or owner of the repository to get insights for. | No       | `${{ github.owner }}`         |\n| `repository`  | The repository to get insights for.                              | No       | `${{ github.repository }}`    |\n| `branch`      | The branch where the stats file will be committed.               | No       | `repository-insights`         |\n| `directory`    | The root directory where the stats file will be stored.         | No       | `./.insights`                |\n| `format`      | The format of the stats file. Options are `json` or `csv`.       | No       | `csv`                         |\n\n## Outputs\n\n| Output Name        | Description                                                 |\n| ------------------ | ----------------------------------------------------------- |\n| `stargazers`       | The total number of stargazers for the repository.           |\n| `commits`          | The total number of commits in the default branch.           |\n| `contributors`     | The total number of unique contributors to the repository.   |\n| `traffic_views`    | The total number of views from yesterday.                    |\n| `traffic_uniques`  | The total number of unique visitors from yesterday.          |\n| `clones_count`     | The total number of clones from yesterday.                   |\n| `clones_uniques`   | The total number of unique cloners from yesterday.           |\n\n## How to use?\n\n### 1. Generate a Github Token\nThe action requires the repository to fetch a Github token other than the tone generated by the action itself, as it accesses traffic/views and clones. This access can only be granted through a private token.\n\nTo generate this and apply this token, follow the steps below:\n\n1. Go to Github Settings in the upper right corner,\n\n2. Go to Developer Settings,\n\n3. Generate a new token,\n    * In the developer settings, click on Personal Access Token,\n    * Click Generate new token,\n    * Give your token a descriptive name (e.g., `Repository Stats Action`),\n    * Under Select scopes, choose the following scopes:\n        * `repo`: Full control of private repositories. Required if your repository is private.\n        * `workflow`: Update GitHub Action workflows.\n    * Click Generate token\n    * Copy the token to your clipboard. You won’t be able to see it again.\n4. Add the Token to Your Repository:\n    * Navigate to your repository on GitHub.\n    * Go to Settings \u003e Secrets and variables \u003e Actions \u003e New repository secret.\n    * Name the secret `TOKEN` (or another name of your choice).\n    * Paste the token you copied earlier and click Add secret.\n\n\n### 2. Add a workflow file\n\nTo use this action in your repository, create a workflow file (e.g., `.github/workflows/update-stats.yml`) with the contents below.\n\nThis is the minimum configurable parameters to run the job, \nand will collect insights daily, on the repository that the workflow sits in, \nand store these as a CSV file, on the branch repository-insights, in directory `/.insights/\u003cowner\u003e/\u003crepository\u003e/stats.csv`.\n\n#### 2.1 Simple example\n\n```yaml\nname: Collect repository insights\n\non:\n  schedule:\n    - cron: '0 0 * * *' # Runs daily at midnight\n  workflow_dispatch:\n\njobs:\n  update-stats:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Collect insights\n        uses: polygenelubricants/repository-insight-tracker@v1.0.0\n        with:\n          github-token: ${{ secrets.TOKEN }}\n```\n\n#### 2.2 Example with all input parameters\n\nHere is an example with full configurability in the action, that fetches insights from another repository (that you own), and subsequently writes the output to console.\n```yaml\nname: Collect repository insights\n\non:\n  schedule:\n    - cron: '0 0 * * *' # Runs daily at midnight\n  workflow_dispatch:\n\njobs:\n  update-stats:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Collect insights\n        id: collect-insights\n        uses: polygenelubricants/repository-insight-tracker@v1.0.0\n        with:\n          github-token: ${{ secrets.TOKEN }}\n          branch: 'repository-insights'\n          format: 'csv'\n          directory: '.insights'\n          owner: 'PolygeneLubricants'\n          repository: 'planning-poker'\n      - name: Write insights to console\n        run: |\n          echo \"Stargazers: ${{ steps.collect-insights.outputs.stargazers }}\"\n          echo \"Commits: ${{ steps.collect-insights.outputs.commits }}\"\n          echo \"Contributors: ${{ steps.collect-insights.outputs.contributors }}\"\n          echo \"Traffic Views Yesterday: ${{ steps.collect-insights.outputs.traffic_views }}\"\n          echo \"Unique Traffic Views Yesterday: ${{ steps.collect-insights.outputs.traffic_uniques }}\"\n          echo \"Clones Yesterday: ${{ steps.collect-insights.outputs.clones_count }}\"\n          echo \"Unique Clones Yesterday: ${{ steps.collect-insights.outputs.clones_uniques }}\"\n```\n\n## How to contribute?\n\n* Clone the repository or download the files.\n* Make your changes to the action's code in `index.js`.\n* Write your tests in `__tests__`\n* Run the tests with `npm test`\n* Pack changes with the following commands:\n  * `npm run build`\n* The packaged index.js can be found under `dist/index.js`.\n* Open a PR in `polygenelubricants/repository-insight-tracker`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygenelubricants%2Frepository-insight-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolygenelubricants%2Frepository-insight-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygenelubricants%2Frepository-insight-tracker/lists"}