{"id":18772531,"url":"https://github.com/urcomputeringpal/optional-required-workflows","last_synced_at":"2026-01-24T22:04:08.420Z","repository":{"id":242698967,"uuid":"804911203","full_name":"urcomputeringpal/optional-required-workflows","owner":"urcomputeringpal","description":"Configure required workflows in your repository. Use path filters. Leave your GitHub org administrator alone.","archived":false,"fork":false,"pushed_at":"2024-09-02T12:52:38.000Z","size":1738,"stargazers_count":3,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T08:58:13.187Z","etag":null,"topics":["actions","branch-protection","ci"],"latest_commit_sha":null,"homepage":"","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/urcomputeringpal.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-23T14:05:41.000Z","updated_at":"2024-06-04T13:24:53.000Z","dependencies_parsed_at":"2025-04-13T08:48:17.192Z","dependency_job_id":null,"html_url":"https://github.com/urcomputeringpal/optional-required-workflows","commit_stats":null,"previous_names":["urcomputeringpal/optional-required-workflows"],"tags_count":0,"template":false,"template_full_name":"actions/typescript-action","purl":"pkg:github/urcomputeringpal/optional-required-workflows","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urcomputeringpal%2Foptional-required-workflows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urcomputeringpal%2Foptional-required-workflows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urcomputeringpal%2Foptional-required-workflows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urcomputeringpal%2Foptional-required-workflows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urcomputeringpal","download_url":"https://codeload.github.com/urcomputeringpal/optional-required-workflows/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urcomputeringpal%2Foptional-required-workflows/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28737858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T21:19:41.845Z","status":"ssl_error","status_checked_at":"2026-01-24T21:13:38.675Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","branch-protection","ci"],"created_at":"2024-11-07T19:29:24.502Z","updated_at":"2026-01-24T22:04:08.387Z","avatar_url":"https://github.com/urcomputeringpal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Optional required workflows\n\nConfigure required workflows in your repository. Use path filters. Leave your\nGitHub org administrator alone.\n\nUse this Action to configure required workflows in a workflow file protected by\n`CODEOWNERS` in your repository instead of in your repository settings.\n\n[![Lint](https://github.com/urcomputeringpal/optional-required-workflows/actions/workflows/linter.yml/badge.svg)](https://github.com/urcomputeringpal/optional-required-workflows/actions/workflows/linter.yml?query=branch%3Amain)\n[![CI](https://github.com/urcomputeringpal/optional-required-workflows/actions/workflows/ci.yml/badge.svg)](https://github.com/urcomputeringpal/optional-required-workflows/actions/workflows/ci.yml?query=branch%3Amain)\n[![Bundling](https://github.com/urcomputeringpal/optional-required-workflows/actions/workflows/check-dist.yml/badge.svg)](https://github.com/urcomputeringpal/optional-required-workflows/actions/workflows/check-dist.yml?query=branch%3Amain)\n[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)\n\n## Problem(s)\n\n### Required status checks are challenging to manage without overly broad permissions\n\nGitHub's\n[required status checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks)\nare configured via branch protection rules. People with **admin permissions** or\na _custom role_ with the \"edit repository rules\" permission to a repository can\n[manage branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule).\nOnly organizations that use GitHub Enterprise Cloud can\n[create custom repository roles](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/managing-custom-repository-roles-for-an-organization).\n\n### Changes to required status checks are not tracked in the repository\n\nChanges to required status checks are not tracked in the repository. This makes\nit hard to coordinate, document, and review changes to required status checks.\nAnd because of the above permissions challenges, it's sometimes someone else's\njob to change this setting. As a result, it can sometimes be hard to know when\nthe change will take place.\n\n### Required status checks are incompatible with path filters\n\nRequired status checks are also\n[incompatible with several other Actions features](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks):\n\n\u003e If a workflow is skipped due to path filtering, branch filtering or a commit\n\u003e message, then checks associated with that workflow will remain in a \"Pending\"\n\u003e state. A pull request that requires those checks to be successful will be\n\u003e blocked from merging.\n\n## Solution\n\nThis Action lets you define a list of workflows that are required to pass on a\npull request **if they are observed to have started once the first one\ncompletes**. It will check to see if those workflows have passed on the same\nSHA. If they have, it will create a successful status. If they haven't, it will\ncreate a failing status.\n\n## How it works\n\n- A workflow in your repository is created that calls this Action\n- This workflow contains a list of other workflows that are required to pass\n- When **at least one** of those workflows **complete** on a PR, this workflow\n  will check to see if **any other listed workflows** are present on the same\n  SHA\n- If **any** of the matching workflows on the same SHA **have failed**, this\n  workflow will create a failure status\n- If **all** of the matching workflows on the same SHA **have passed**, this\n  workflow will create a successful status\n- If **some** of the matching workflows on the same SHA **are missing**, this\n  workflow **will still create a successful status** if at least one has passed\n  - This allows you to use path filters to skip certain workflows on certain\n    paths and still mark them as required.\n- If we're still waiting, a pending status will be created that reports what\n  we're waiting for\n- If none of the listed workflows report a completed status via GitHub's API,\n  we'll refresh until we see a status\n\n## Setup\n\n### Workflow\n\nAdd an workflow like the following to your repository:\n\n```yaml\nname: Required\n\non:\n  workflow_run:\n    workflows:\n      - Check Transpiled JavaScript\n      - Continuous Integration\n      - Lint Codebase\n    types:\n      - completed\n\npermissions:\n  contents: read\n  actions: read\n  statuses: write\n\njobs:\n  success:\n    if:\n      contains(fromJSON('[\"merge_group\", \"pull_request\"]'),\n      github.event.workflow_run.event)\n    name: Check required workflow status\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      actions: read\n      statuses: write\n    steps:\n      - uses: actions/checkout@v3\n      - uses: urcomputeringpal/optional-required-workflows@main\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          status-name: Required\n          must-succeed-if-run: |\n            Check Transpiled JavaScript\n            Continuous Integration\n            Lint Codebase\n```\n\n### `CODEOWNERS`\n\nAdd this file to `CODEOWNERS` to protect the contents of this file on your\ndefault branch:\n\n```plaintext\n.github/workflows/required.yml @your-org/your-repo-admins\n```\n\n### Required workflows\n\nHave a GitHub organization admin or someone with the the \"edit repository rules\"\npermission on your repository require the `Required` status in your\n[branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule).\n\nOffer to your GitHub organization admin to be listed on the `CODEOWNERS` line,\neither;\n\n- As the only entry (retains previous behavior, except they just have to\n  approve)\n- As an additional entry (either they or you can approve)\n- Or not at all (they delegate the review/approval of required status on this\n  repository checks to your team)\n\n## Caveats / Possible future enhancements\n\n- Many workflows can generate statuses of the same name. In the future, optional\n  support for matching on `event.workflow_run.path` may be desirable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furcomputeringpal%2Foptional-required-workflows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furcomputeringpal%2Foptional-required-workflows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furcomputeringpal%2Foptional-required-workflows/lists"}