{"id":27021731,"url":"https://github.com/hmknapp/github-actions-matrix-run-id","last_synced_at":"2025-04-04T19:52:10.357Z","repository":{"id":229224155,"uuid":"308069127","full_name":"HMKnapp/github-actions-matrix-run-id","owner":"HMKnapp","description":"Fetches the current workflow run ID of a matrix job from the GitHub API","archived":false,"fork":false,"pushed_at":"2020-10-28T19:58:53.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-22T21:34:55.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HMKnapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2020-10-28T15:59:52.000Z","updated_at":"2024-03-22T21:34:57.313Z","dependencies_parsed_at":"2024-03-22T21:45:26.339Z","dependency_job_id":null,"html_url":"https://github.com/HMKnapp/github-actions-matrix-run-id","commit_stats":null,"previous_names":["hmknapp/github-actions-matrix-run-id"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMKnapp%2Fgithub-actions-matrix-run-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMKnapp%2Fgithub-actions-matrix-run-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMKnapp%2Fgithub-actions-matrix-run-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HMKnapp%2Fgithub-actions-matrix-run-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HMKnapp","download_url":"https://codeload.github.com/HMKnapp/github-actions-matrix-run-id/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242607,"owners_count":20907128,"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":[],"created_at":"2025-04-04T19:52:09.552Z","updated_at":"2025-04-04T19:52:10.350Z","avatar_url":"https://github.com/HMKnapp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-actions-matrix-run-id\nFetches the current workflow run ID of a matrix job from the GitHub API\n\n**Pull Requests welcome!**\n\n## Setup\n### Environment Variables\n\n`MATRIX_ID` *required*\n\n`GH_TOKEN` *conditional* PAT is required only for private repositories\n\n### Example Workflow\nMatrix\n```\njobs:\n  Runs:\n    strategy:\n      matrix:\n        example_run: [run_one, run_two]\n```\nPass Matrix job ID to environment\n```\n    steps:   \n      - name: Build\n        run: npm run build\n        env:\n          MATRIX_ID: ${{ matrix.example_run }}\n          GH_TOKEN: ${{ secrets.GH_TOKEN }}\n```\n\n## Usage\n### Install\n\n```\nnpm install 'HMKnapp/github-actions-matrix-run-id#master'\n```\n\n### Use via CLI\nOutput: Numeric run ID\n\n```\nnode ./node_modules/github-actions-matrix-run-id/index.js\n\u003e 1234567890\n```\nOptional: Add parameter `--url` to get full URL\n```\nnode ./node_modules/github-actions-matrix-run-id/index.js --url\n\u003e https://github.com/HMKnapp/github-actions-matrix-run-id/runs/1234567890\n```\n\n### Use as Module\nExample\n```js\nconst { getRunID } = require(\"github-actions-matrix-run-id\");\n\nasync function printID() {\n  const id = await getRunID();\n  console.log(id);\n}\n\nprintID();\n```\n## Known Limitations\nIssues getting ID for Pull Request runs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmknapp%2Fgithub-actions-matrix-run-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmknapp%2Fgithub-actions-matrix-run-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmknapp%2Fgithub-actions-matrix-run-id/lists"}