{"id":16950564,"url":"https://github.com/tomchv/wait-my-workflow","last_synced_at":"2025-03-22T13:31:25.740Z","repository":{"id":36977372,"uuid":"283534087","full_name":"TomChv/wait-my-workflow","owner":"TomChv","description":"The objective of this action is to wait the end of a workflow","archived":false,"fork":false,"pushed_at":"2023-05-12T09:26:12.000Z","size":799,"stargazers_count":13,"open_issues_count":21,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-17T20:41:55.719Z","etag":null,"topics":["github-actions","workflow-management"],"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/TomChv.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-29T15:21:40.000Z","updated_at":"2023-07-14T18:51:54.000Z","dependencies_parsed_at":"2024-10-28T13:20:08.245Z","dependency_job_id":"04ea6986-13de-4106-99fc-32adf89369ac","html_url":"https://github.com/TomChv/wait-my-workflow","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.36363636363636365","last_synced_commit":"2da0b8a92211e6d7c9964602b99a7052080a1d61"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomChv%2Fwait-my-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomChv%2Fwait-my-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomChv%2Fwait-my-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomChv%2Fwait-my-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomChv","download_url":"https://codeload.github.com/TomChv/wait-my-workflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244962819,"owners_count":20539229,"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":["github-actions","workflow-management"],"created_at":"2024-10-13T21:57:58.794Z","updated_at":"2025-03-22T13:31:25.322Z","avatar_url":"https://github.com/TomChv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/actions/typescript-action/actions\"\u003e\u003cimg alt=\"typescript-action status\" src=\"https://github.com/actions/typescript-action/workflows/build-test/badge.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Github Action : Wait my workflow\n\nThis github action is based on  [wait-for-check](https://github.com/fountainhead/action-wait-for-check) action, please go put a star on his repo if you like my action. I simply altered the actions to match my needs.\n\nIt works thanks to the [check states](https://docs.github.com/en/rest/reference/checks) (github action jobs). The action will ping the github API and check if a job is running on the repo given as argument.\n\nThe objective of this action is to allow chained workflows. If the expected workflow doesn't run / exist, the action just stops waiting in order to don't lose time.\n\nThe timeout starts when the job is starting and not when it is in a queue. This ensures that you do not have a timeout for nothing.\n\n**Tips**: be sure all yours jobs has a unique name in order to don't have surprise.\n\n**Tips**: Remember that you can also wait multiples steps. Simply wait for each step as you go along (if the step is already completed, the conclusion remains intact).\n\n## Example\n\nLet's imagine a scenario where you have to wait for a build to finish before launching your deployment workflow.\nYour workflows files should look like this :\n\n\n**Build workflow**\n```yaml\nname: Build my app\n\non:\n  push:\n\njobs:\n  build: # Here is your checkName var\n    runs-on: self-hosted\n\n    steps:\n      ## Build you application.. Push it to docker for example\n```\n\n\u003e Your build step can also be in the deployment file. It's just a step.\n\n**Deployment workflow**\n\nOn this workflow, 4 conditions can be triggered depending on the progress of the build(s)\n\n```yaml\nname: Deploy my app\n\non:\n  push:\n\njobs:\n  deploy:\n    steps:\n      - name: Wait my build\n        uses: tomchv/wait-my-workflow@v1.1.0\n        id: wait-build\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          checkName: build\n          ref: ${{ github.event.pull_request.head.sha || github.sha }}\n          intervalSeconds: 10\n          timeoutSeconds: 100\n\n      - name: Do something if build success\n        if: steps.wait-build.outputs.conclusion == 'success'\n        run: echo success \u0026\u0026 true # You can also just continue with\n\n      - name: Do something if build isn't launch\n        if: steps.wait-build.outputs.conclusion == 'does not exist'\n        run: echo job does not exist \u0026\u0026 true\n\n      - name: Do something if build fail\n        if: steps.wait-build.outputs.conclusion == 'failure'\n        run: echo fail \u0026\u0026 false # fail if build fail\n\n      - name: Do something if build timeout\n        if: steps.wait-build.outputs.conclusion == 'timed_out'\n        run: echo Timeout \u0026\u0026 false # fail if build time out\n      \n      - name: Deploy my add\n      # Deploy my app... or wait an other build\n```\n\n## Inputs\n\nThis Action accepts the following configuration parameters via `with:`\n\n- `token`\n\n  **Required**\n  \n  The GitHub token to use for making API requests. Typically, this would be set to `${{ secrets.GITHUB_TOKEN }}`.\n  \n- `checkName`\n\n  **Required**\n  \n  The name of the GitHub check to wait for. For example, `build` or `deploy`.\n\n- `ref`\n\n  **Default: `github.sha`**\n  \n  The Git ref of the commit you want to poll for a passing check.\n  \n  *PROTIP: You may want to use `github.pull_request.head.sha` when working with Pull Requests.*\n\n  \n- `repo`\n\n  **Default: `github.repo.repo`**\n  \n  The name of the Repository you want to poll for a passing check.\n\n- `owner`\n\n  **Default: `github.repo.owner`**\n  \n  The name of the Repository's owner you want to poll for a passing check.\n\n- `timeoutSeconds`\n\n  **Default: `600`**\n\n  The number of seconds to wait for the check to complete. If the check does not complete within this amount of time, this Action will emit a `conclusion` value of `timed_out`.\n  \n- `intervalSeconds`\n\n  **Default: `10`**\n\n  The number of seconds to wait before each poll of the GitHub API for checks on this commit.\n\n## Outputs\n\nThis Action emits a single output named `conclusion`. Like the field of the same name in the [CheckRunEvent API Response](https://developer.github.com/v3/activity/events/types/#checkrunevent-api-payload), it may be one of the following values:\n\n- `success`\n- `failure`\n- `neutral`\n- `timed_out`\n- `action_required`\n\nThese correspond to the `conclusion` state of the Check you're waiting on. In addition, this action will emit a conclusion of `timed_out` if the Check specified didn't complete within `timeoutSeconds`.\n\nIf the job does not exist, this Action will emit `not found` as conclusion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomchv%2Fwait-my-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomchv%2Fwait-my-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomchv%2Fwait-my-workflow/lists"}