{"id":18044762,"url":"https://github.com/natterstefan/action-eligible-actor","last_synced_at":"2025-10-12T19:45:16.906Z","repository":{"id":65161043,"uuid":"556381417","full_name":"natterstefan/action-eligible-actor","owner":"natterstefan","description":"Execute a GitHub Action only if the (triggering) actor is eligible (=authorised) to do so.","archived":false,"fork":false,"pushed_at":"2023-03-06T04:12:55.000Z","size":1966,"stargazers_count":3,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-22T10:00:51.337Z","etag":null,"topics":["actions","github-actions","github-workflows","permissions"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/eligible-actor","language":"TypeScript","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/natterstefan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":["natterstefan"],"patreon":"natterstefan","custom":["https://www.paypal.me/natterstefan","https://www.buymeacoffee.com/natterstefan"]}},"created_at":"2022-10-23T18:17:52.000Z","updated_at":"2025-02-20T15:53:56.000Z","dependencies_parsed_at":"2024-10-30T18:10:41.564Z","dependency_job_id":null,"html_url":"https://github.com/natterstefan/action-eligible-actor","commit_stats":{"total_commits":25,"total_committers":3,"mean_commits":8.333333333333334,"dds":"0.19999999999999996","last_synced_commit":"2918b24d6a1149ad249b10e49c5a7d56acb3546f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/natterstefan/action-eligible-actor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natterstefan%2Faction-eligible-actor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natterstefan%2Faction-eligible-actor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natterstefan%2Faction-eligible-actor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natterstefan%2Faction-eligible-actor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natterstefan","download_url":"https://codeload.github.com/natterstefan/action-eligible-actor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natterstefan%2Faction-eligible-actor/sbom","scorecard":{"id":676137,"data":{"date":"2025-08-11","repo":{"name":"github.com/natterstefan/action-eligible-actor","commit":"2918b24d6a1149ad249b10e49c5a7d56acb3546f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:35","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:36","Info: topLevel 'contents' permission set to 'read': .github/workflows/check-dist.yml:24","Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Warn: no topLevel permission defined: .github/workflows/release-major.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:16","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check-dist.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/check-dist.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check-dist.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/check-dist.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check-dist.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/check-dist.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/codeql-analysis.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint-pr-title.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/lint-pr-title.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-major.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/release-major.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/natterstefan/action-eligible-actor/test.yml/main?enable=pin","Info:   0 out of  13 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   4 out of   4 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"22 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-hpx4-r86g-5jrg","Warn: Project is vulnerable to: GHSA-prr3-c3m5-p7q2","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T21:32:16.493Z","repository_id":65161043,"created_at":"2025-08-21T21:32:16.493Z","updated_at":"2025-08-21T21:32:16.493Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012681,"owners_count":26085159,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","github-actions","github-workflows","permissions"],"created_at":"2024-10-30T18:10:36.026Z","updated_at":"2025-10-12T19:45:16.889Z","avatar_url":"https://github.com/natterstefan.png","language":"TypeScript","funding_links":["https://github.com/sponsors/natterstefan","https://patreon.com/natterstefan","https://www.paypal.me/natterstefan","https://www.buymeacoffee.com/natterstefan"],"categories":[],"sub_categories":[],"readme":"# action-eligible-actor\n\n[![Test](https://github.com/natterstefan/action-eligible-actor/actions/workflows/test.yml/badge.svg)](https://github.com/natterstefan/action-eligible-actor/actions/workflows/test.yml) [![CodeQL](https://github.com/natterstefan/action-eligible-actor/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/natterstefan/action-eligible-actor/actions/workflows/codeql-analysis.yml)\n\n\u003e Execute a GitHub Action only if the (triggering) actor is eligible (=authorised) to do so.\n\n## Use Case\n\nAssume you have multiple workflows and a complex set of rules who can manually\ntrigger which workflow. Instead of adding `if` conditions here and there you can\ndefine a set of rules (in `eligible-actors-rules.json`) and use this rule in\nmultiple places. The management of the rules is centralized in one place.\n\nBut even if you only have a `deployment.yml` or `release.yml` workflow, this\naction can be very useful.\n\n## Usage\n\nAdd the action to your workflow, define `rulesFile` and the `ruleId` to\napply to and decide if the workflow should fail silently (`failSilently`) or\nnot.\n\n### Before\n\n```yml\n- name: Release Tag\n  if: ${{ github.actor == 'username' }}\n  run: npx semantic-release\n```\n\n### After\n\n```yml\n- name: Can actor release?\n  uses: natterstefan/action-eligible-actor@v1\n  with:\n    rulesFile: 'eligible-actors-rules.json' # default\n    ruleId: 1 # required\n\n# if `failSilently` for the rule with the id `1` was set to `false`, this step\n# will not start if the actor is not eligible (included in `eligibleActors`).\n# Instead the workflow will exit with 1 (=failure).\n- name: Release Tag\n  run: npx semantic-release\n```\n\nWith the following `eligible-actors-rules.json` ([type definition](src/types.ts#L14-L36)):\n\n```json\n[\n  {\n    \"id\": \"1\",\n    \"description\": \"Repository owner only\",\n    \"eligibleActors\": [\"natterstefan\"],\n    \"failureMessage\": \"Only the repository owner can do this!\",\n    \"failSilently\": false\n  }\n]\n```\n\nTake a look at more examples in the\n[`test.yml`](.github/workflows/test.yml#L24) Workflow file.\n\n## Development\n\n\u003e First, you'll need to have a reasonably modern version of `node` handy. This\n\u003e won't work with versions older than 16, for instance.\n\nInstall the dependencies\n\n```bash\nnpm install\n```\n\nBuild the package for distribution\n\n```bash\n# package the source files\nnpm run package\n# afterward create a release with the release GitHub action\n```\n\nRun the tests\n\n```bash\nnpm run package # or npm run dev (watch mode)\nnpm test\n```\n\nTest the workflow locally with \u003chttps://github.com/nektos/act\u003e!\n\n```bash\nnpm run package # or npm run dev (watch mode)\nact -j testFailSilentyTrue \u0026\u0026 act -j testFailSilentyFalse\n```\n\n## Todos / To be discussed\n\n- [ ] add `actor` input instead of implicitly using `process.env.GITHUB_ACTOR`.\n\n## Alternatives\n\n- [natterstefan/action-authorised-actor](https://github.com/natterstefan/action-authorised-actor): configure if the current actor is authorised to run the workflow with GitHub Secrets.\n- [actions-cool/check-user-permission: 👮 A GitHub Action to check user permission of the current repository.](https://github.com/actions-cool/check-user-permission)\n- [im-open/is-actor-authorized: Action that determines if the actor who initiated the workflow is authorized to do so.](https://github.com/im-open/is-actor-authorized)\n\n## LICENSE\n\n[MIT](LICENSE)\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://natterstefan.me/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1043668?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eStefan Natter\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-natterstefan\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/natterstefan/action-eligible-actor/commits?author=natterstefan\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/natterstefan/action-eligible-actor/commits?author=natterstefan\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatterstefan%2Faction-eligible-actor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatterstefan%2Faction-eligible-actor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatterstefan%2Faction-eligible-actor/lists"}