{"id":18997698,"url":"https://github.com/s0/libyear-node-action","last_synced_at":"2025-04-22T14:24:37.135Z","repository":{"id":42649445,"uuid":"367061581","full_name":"s0/libyear-node-action","owner":"s0","description":"Track NPM dependency freshness, and calculate how pull requests will impact this","archived":false,"fork":false,"pushed_at":"2024-05-17T10:44:32.000Z","size":524,"stargazers_count":10,"open_issues_count":10,"forks_count":6,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-11T07:23:55.768Z","etag":null,"topics":["actions","dependencies","github-action","github-actions","libyear","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"s0"}},"created_at":"2021-05-13T13:43:49.000Z","updated_at":"2025-02-20T03:22:54.000Z","dependencies_parsed_at":"2024-11-08T17:45:25.879Z","dependency_job_id":"2a4366df-f727-480c-aac2-bcfab2137094","html_url":"https://github.com/s0/libyear-node-action","commit_stats":{"total_commits":32,"total_committers":1,"mean_commits":32.0,"dds":0.0,"last_synced_commit":"47d391df2c801bf39a1674895cfcd2e85b3f2720"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0%2Flibyear-node-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0%2Flibyear-node-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0%2Flibyear-node-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0%2Flibyear-node-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s0","download_url":"https://codeload.github.com/s0/libyear-node-action/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249273885,"owners_count":21241988,"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","dependencies","github-action","github-actions","libyear","nodejs"],"created_at":"2024-11-08T17:42:12.323Z","updated_at":"2025-04-16T20:31:36.209Z","avatar_url":"https://github.com/s0.png","language":"TypeScript","funding_links":["https://github.com/sponsors/s0"],"categories":[],"sub_categories":[],"readme":"# Node dependency libyear stats \u0026 PR checks\n\n[![codecov](https://codecov.io/gh/s0/libyear-node-action/branch/develop/graph/badge.svg)](https://codecov.io/gh/s0/libyear-node-action) ![](https://raw.githubusercontent.com/s0/libyear-node-action/badges/drift.svg) ![](https://raw.githubusercontent.com/s0/libyear-node-action/badges/pulse.svg) ![](https://raw.githubusercontent.com/s0/libyear-node-action/badges/releases.svg) ![](https://raw.githubusercontent.com/s0/libyear-node-action/badges/major.svg) ![](https://raw.githubusercontent.com/s0/libyear-node-action/badges/minor.svg)\n\nThis GitHub Action will allow you to track how well a repository is keeping\nup-to-date with NPM dependencies, using [libyear](https://libyear.com/).\n\nThis action is powered by the NPM package by the same name:\n[libyear](https://www.npmjs.com/package/libyear).\n\nIt can be used in combination with other actions to generate badges (see below).\n\n## Usage\n\nSimply include the action `s0/libyear-node-action` in the appropriate point in\nyour workflow, and pass in the required configuration options:\n\n*Note: For best results,\nit is recommended you install your NPM using your preferred package manager\nbefore running this action*\n\n**Note: We recommend using the\n[latest release](https://github.com/s0/libyear-node-action/releases) rather than\n`develop` to avoid future breaking changes with your workflow.\n\n```yml\njobs:\n  deploy:\n    name: Deploy\n    runs-on: ubuntu-latest\n    steps:\n\n    # Any prerequisite steps\n    - uses: actions/checkout@master\n    - run: npm install\n\n    # Calculate libyear\n    - uses: s0/libyear-node-action@develop\n```\n\n## Configuration\n\nAll configuration options are passed in via `env`, as environment variables. For example:\n\n```yml\njobs:\n  deploy:\n    # ...\n    - uses: s0/libyear-node-action@develop\n      env:\n        FOLDER: some/sub/directory\n```\n\n### Full list of variables\n\n| Env Variable       | Description                                                                                      | Required?     |\n| ------------------ | ------------------------------------------------------------------------------------------------ | ------------- |\n| `FOLDER`           | Which directory within your repository should `libyear` be run in. (Default: root of repository) | No            |\n\n## Outputs\n\nThis action generates outputs that can be used in later steps or outputs\n*(for example to generate badges to display in your README, see below)*.\n\nThe following outputs are generated.\nEach of them represents a\n[metric from libyear](https://github.com/jdanil/libyear#metrics).\n\n| Output     | Description                                           |\n| ---------- | ----------------------------------------------------- |\n| `drift`    | A floating-point number with 2 decimal places         |\n| `pulse`    | A floating-point number with 2 decimal places         |\n| `releases` | An integer                                            |\n| `major`    | An integer                                            |\n| `minor`    | An integer                                            |\n| `patch`    | An integer                                            |\n\n### Example: Generating badges using libyear stats\n\nHere's an example workflow that will generate a badge for you and push it to\na special branch that can be referenced in e.g. your README.\nIt uses the actions\n[`emibcn/badge-action`](https://github.com/emibcn/badge-action) and\n[`s0/git-publish-subdir-action`](https://github.com/s0/git-publish-subdir-action)\nin addition to this action.\n\n```yml\nname: Generate Badges\non:\n  # Run on pushes to your main branch\n  push:\n    branches:\n      - develop\n  # Run every day\n  schedule:\n    - cron: \"0 0 * * *\"\n\njobs:\n  get-badges:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@master\n    - name: Use Node.js\n      uses: actions/setup-node@v1\n      with:\n        node-version: 10.x\n\n    # Install dependencies and run libyear\n    # (notice how the libyear step has an id, this is referenced later)\n    - run: npm install\n    - id: libyear\n      uses: s0/libyear-node-action@develop\n\n    # Generate a badge and store it in the badge/directory\n    - run: mkdir badges\n    - uses: emibcn/badge-action@v1\n      with:\n        label: 'libyear'\n        # Here is where we use the output from the libyear step\n        status: ${{ steps.libyear.outputs.drift }} year(s) behind\n        color: 'blue'\n        path: 'badges/drift.svg'\n\n    # Upload the directory \"badge\" as a branch \"badge\" on the same repo\n    - uses: s0/git-publish-subdir-action@develop\n      env:\n        REPO: self\n        BRANCH: badges\n        FOLDER: badges\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        SQUASH_HISTORY: true\n```\n\nWe use this for this repository, you can see the workflow here:\n[`badges.yml`](.github/workflows/badges.yml)\n\n## TODO\n\nPlease see the [issues](https://github.com/s0/libyear-node-action/issues) for\ndetails of planned work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs0%2Flibyear-node-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs0%2Flibyear-node-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs0%2Flibyear-node-action/lists"}