{"id":13431545,"url":"https://github.com/Jaid/action-sync-node-meta","last_synced_at":"2025-03-16T11:31:56.342Z","repository":{"id":39674365,"uuid":"253713504","full_name":"Jaid/action-sync-node-meta","owner":"Jaid","description":"GitHub Action that syncs package.json with the repository metadata.","archived":false,"fork":false,"pushed_at":"2023-03-02T23:51:16.000Z","size":10789,"stargazers_count":30,"open_issues_count":11,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-13T03:24:30.847Z","etag":null,"topics":["action","action-sync-node-meta","actions","bot","github-action","github-actions","github-api","metadata","node","node-js","nodejs","repository","sync-node-meta","util","utility","workflow"],"latest_commit_sha":null,"homepage":"https://github.com/Jaid/action-sync-node-meta","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/Jaid.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"Jaid","custom":"https://twitch.tv/products/jaidchen"}},"created_at":"2020-04-07T07:02:55.000Z","updated_at":"2024-09-30T17:21:37.000Z","dependencies_parsed_at":"2024-01-16T01:25:48.839Z","dependency_job_id":"85375ee9-64d0-4037-8884-9ab1c74804a7","html_url":"https://github.com/Jaid/action-sync-node-meta","commit_stats":{"total_commits":261,"total_committers":4,"mean_commits":65.25,"dds":0.07662835249042144,"last_synced_commit":"6eb235046d1bcfe3460260051044ca3bb455c5eb"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaid%2Faction-sync-node-meta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaid%2Faction-sync-node-meta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaid%2Faction-sync-node-meta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaid%2Faction-sync-node-meta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaid","download_url":"https://codeload.github.com/Jaid/action-sync-node-meta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243863259,"owners_count":20360288,"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":["action","action-sync-node-meta","actions","bot","github-action","github-actions","github-api","metadata","node","node-js","nodejs","repository","sync-node-meta","util","utility","workflow"],"created_at":"2024-07-31T02:01:03.950Z","updated_at":"2025-03-16T11:31:52.633Z","avatar_url":"https://github.com/Jaid.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Jaid","https://twitch.tv/products/jaidchen","https://github.com/sponsors/jaid"],"categories":["JavaScript"],"sub_categories":[],"readme":"# action-sync-node-meta\n\n\n\u003ca href=\"https://raw.githubusercontent.com/jaid/action-sync-node-meta/master/license.txt\"\u003e\u003cimg src=\"https://img.shields.io/github/license/jaid/action-sync-node-meta?style=flat-square\" alt=\"License\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/sponsors/jaid\"\u003e\u003cimg src=\"https://img.shields.io/badge/\u003c3-Sponsor-FF45F1?style=flat-square\" alt=\"Sponsor action-sync-node-meta\"/\u003e\u003c/a\u003e  \n\u003ca href=\"https://actions-badge.atrox.dev/jaid/action-sync-node-meta/goto\"\u003e\u003cimg src=\"https://img.shields.io/endpoint.svg?style=flat-square\u0026url=https%3A%2F%2Factions-badge.atrox.dev%2Fjaid%2Faction-sync-node-meta%2Fbadge\" alt=\"Build status\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/jaid/action-sync-node-meta/commits\"\u003e\u003cimg src=\"https://img.shields.io/github/commits-since/jaid/action-sync-node-meta/v2.0.0?style=flat-square\u0026logo=github\" alt=\"Commits since v2.0.0\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/jaid/action-sync-node-meta/commits\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/jaid/action-sync-node-meta?style=flat-square\u0026logo=github\" alt=\"Last commit\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/jaid/action-sync-node-meta/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/jaid/action-sync-node-meta?style=flat-square\u0026logo=github\" alt=\"Issues\"/\u003e\u003c/a\u003e  \n\n**GitHub Action that syncs package.json with the repository metadata.**\n\n\nThere are values that are meant to be the same. Why not automatically keep them synchronized?\n\n![Banner](readme/banner.jpg)\n\n### Example output\n\n![Example output](readme/output.png)\n\n\n\n\n\n## Example\n\n### overwrite-file\n\nExample workflow that runs whenever commits are pushed on branch `master`.  \nThis will overwrite the `package.json` file if it differs from the GitHub repository info.\n\nThis is the recommended syncing direction, because of the more simple setup (no need to manually add a secret to the repository settings) and the advantages of git commits (better monitoring, revertability).\n\n`.github/workflows/example.yml`\n```yaml\nname: Sync package.json with repository info\non:\n  push:\n    branches: [master]\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: actions/checkout\n        uses: actions/checkout@v2.3.4\n      - name: Jaid/action-sync-node-meta\n        uses: jaid/action-sync-node-meta@v2.0.0\n        with:\n          githubToken: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### overwrite-github\n\nExample workflow that runs whenever commits are pushed on branch `master`.  \nThis will change the GitHub repository info whenever it differs from the content of `package.json`.\n\nThe secret `customGithubToken` is forwarded to the input `githubToken`. It has to be a [personal access token](https://github.com/settings/tokens) with scope \"repo\" added in [your repository's secrets settings](https://github.com/YOUR_NAME/YOUR_REPOSITORY/settings/secrets).\n\n`.github/workflows/example2.yml`\n```yaml\nname: Sync repository info with package.json\non:\n  push:\n    branches: [master]\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: actions/checkout\n        uses: actions/checkout@v2.3.4\n      - name: Jaid/action-sync-node-meta\n        uses: jaid/action-sync-node-meta@v2.0.0\n        with:\n          direction: overwrite-github\n          githubToken: ${{ secrets.customGithubToken }}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eDetailed setup\u003c/summary\u003e\nGo to your account settings and then to “Developer settings”.\n\n![Token setup: Step 1](readme/tokenSteps/01.png)\n\nGo to “Personal access tokens”.\n\n![Token setup: Step 2](readme/tokenSteps/02.png)\n\nClick “Generate new token”.\n\n![Token setup: Step 3](readme/tokenSteps/03.png)\n\nGive it a good title, so you still know what your token does in one year. Add „repo“ permissions.\n\n![Token setup: Step 4](readme/tokenSteps/04.png)\n\nCopy the generated token.\n\n![Token setup: Step 5](readme/tokenSteps/05.png)\n\nGo to the repository that uses action-sync-node-meta. Go to “Settings”, “Secrets”.\n\n![Token setup: Step 6](readme/tokenSteps/06.png)\n\nClick “New repository secret”.\n\n![Token setup: Step 7](readme/tokenSteps/07.png)\n\nAdd the secret token from your clipboard. Name the token “repoGithubToken” or anything you like.\n\n![Token setup: Step 8](readme/tokenSteps/08.png)\n\nNow pass the token to action-sync-node-meta in your workflow file.\n\n```yaml\n- name: Jaid/action-sync-node-meta\n  uses: jaid/action-sync-node-meta@v2.0.0\n  with:\n    direction: overwrite-github\n    githubToken: ${{ secrets.repoGithubToken }}\n```\n\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n## Options\n\n\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eDefault\u003c/th\u003e\n\u003cth\u003eInfo\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003egithubToken\u003c/td\u003e\n\u003ctd\u003e*\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003eRepository token for allowing the action to make commits or change the repository info. If direction is \"overwrite-file\", this input be set from forwarding secrets.GITHUB_TOKEN in the workflow file. If direction is \"overwrite-github\", a custom personal access token with \"repo\" scope has to be created.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eapprove\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003etrue\u003c/td\u003e\n\u003ctd\u003eIf true and direction is \"overwrite-file\", pull requests created by this action are automatically approved and merged.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ebranch\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003eaction-sync-node-meta\u003c/td\u003e\n\u003ctd\u003eThe name of the branch to make changes on (only for direction \"overwrite-file\"). Substring “{random}” will be replaced with randomized characters.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ecommitMessage\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003eautofix: Updated package.json[{changes}]\u003c/td\u003e\n\u003ctd\u003eCommit message for package.json changes (only for direction \"overwrite-file\"). Substring “{changes}” will be replaced with a list of changed package.json fields.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003edirection\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003eoverwrite-file\u003c/td\u003e\n\u003ctd\u003eThe syncing direction, can be \"overwrite-file\" or \"overwrite-github\". If \"overwrite-file\", the file package.json will be edited in a pull request according to the GitHub repository info. If \"overwrite-github\", the GitHub repository info will be changed according to the content of the package.json file.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ejsonFinalNewline\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003etrue\u003c/td\u003e\n\u003ctd\u003eIf true and direction is \"overwrite-file\", the updated package.json will have a final newline.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eremoveBranch\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003etrue\u003c/td\u003e\n\u003ctd\u003eIf true and direction is \"overwrite-file\" and approve is also true, automatically merged pull requests will delete their branch afterwards.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003esyncDescription\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003etrue\u003c/td\u003e\n\u003ctd\u003eIf true, package.json[description] will be synced with GitHub repository description.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003esyncHomepage\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003etrue\u003c/td\u003e\n\u003ctd\u003eIf true, package.json[homepage] will be synced with GitHub repository homepage.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003esyncKeywords\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003ctd\u003etrue\u003c/td\u003e\n\u003ctd\u003eIf true, package.json[keywords] will be synced with GitHub repository topics.\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Development\n\n\n\nSetting up:\n```bash\ngit clone git@github.com:jaid/action-sync-node-meta.git\ncd action-sync-node-meta\nnpm install\n```\n\n\n## License\n[MIT License](https://raw.githubusercontent.com/jaid/action-sync-node-meta/master/license.txt)  \nCopyright © 2021, Jaid \\\u003cjaid.jsx@gmail.com\u003e (https://github.com/jaid)\n\n\u003c!---\nReadme generated with tldw v7.0.0\nhttps://github.com/Jaid/tldw\n--\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaid%2Faction-sync-node-meta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJaid%2Faction-sync-node-meta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaid%2Faction-sync-node-meta/lists"}