Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait on all jobs by omitting running-workflow-name not working for amplify check hook #73

Open
jacktattersall1 opened this issue Sep 2, 2022 · 3 comments

Comments

@jacktattersall1
Copy link

Hi, i am having issues with waiting on an aws amplify deploy check to complete

name: CI
on:
  pull_request:
    branches: ["master"]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:
    jobs:
      test:
        name: CI Test
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v3
          - name: Wait for amplify preview to deploy
            uses: lewagon/[email protected]
            with:
              ref: ${{ github.ref }}
              repo-token: ${{ secrets.GITHUB_TOKEN }}
              wait-interval: 10
          - uses: actions/setup-node@v2
          ................

I have omitted running-workflow-name: as to force this job to wait for all other jobs, as specifying the amplify job name wasn't working either.

image

Maybe the config is wrong??

@talwat
Copy link

talwat commented Sep 3, 2022

For me it's not working either, even when I do include running-workflow-name

@jacktattersall1
Copy link
Author

for reference, heres the result of the curl command to gh api

{
    "total_count": 2,
    "check_runs": [
      {
        "id": 8154832077,
        "name": "AWS Amplify Console Web Preview",
        "node_id": "CR_kwDOHF8L2M8AAAAB5hDczQ",
        "head_sha": "e97ebb905a1642df07a9f58792e3465ef7bb6a91",
        "external_id": "arn:aws:amplify:eu-west-2:475154751441:omited",
        "url": "https://api.github.com/repos/omited/check-runs/8154832077",
        "html_url": "https://github.com/omited/runs/8154832077",
        "details_url": "https://console.aws.amazon.com/amplify/omited",
        "status": "in_progress",
        "conclusion": null,
        "started_at": "2022-09-02T11:10:18Z",
        "completed_at": null,
        "output": {
          "title": null,
          "summary": null,
          "text": null,
          "annotations_count": 0,
          "annotations_url": "https://api.github.com/repos/omited/check-runs/8154832077/annotations"
        },
        "check_suite": {
          "id": 8106614629
        },
        "app": {
          "id": 43827,
          "slug": "aws-amplify-eu-west-2",
          "node_id": "MDM6QXBwNDM4Mjc=",
          "owner": {
            "login": "aws-amplify-console",
            "id": 45215622,
            "node_id": "MDQ6VXNlcjQ1MjE1NjIy",
            "avatar_url": "https://avatars.githubusercontent.com/u/45215622?v=4",
            "gravatar_id": "",
            "url": "https://api.github.com/users/aws-amplify-console",
            "html_url": "https://github.com/aws-amplify-console",
            "followers_url": "https://api.github.com/users/aws-amplify-console/followers",
            "following_url": "https://api.github.com/users/aws-amplify-console/following{/other_user}",
            "gists_url": "https://api.github.com/users/aws-amplify-console/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/aws-amplify-console/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/aws-amplify-console/subscriptions",
            "organizations_url": "https://api.github.com/users/aws-amplify-console/orgs",
            "repos_url": "https://api.github.com/users/aws-amplify-console/repos",
            "events_url": "https://api.github.com/users/aws-amplify-console/events{/privacy}",
            "received_events_url": "https://api.github.com/users/aws-amplify-console/received_events",
            "type": "User",
            "site_admin": false
          },
          "name": "AWS Amplify (eu-west-2)",
          "description": "Hosting for fullstack serverless web apps with continuous deployment",
          "external_url": "https://eu-west-2.console.aws.amazon.com/amplify/home?region=eu-west-2#/",
          "html_url": "https://github.com/apps/aws-amplify-eu-west-2",
          "created_at": "2019-10-16T19:05:27Z",
          "updated_at": "2022-03-29T18:24:04Z",
          "permissions": {
            "checks": "write",
            "contents": "read",
            "metadata": "read",
            "pull_requests": "write",
            "repository_hooks": "write",
            "single_file": "write"
          },
          "events": [
            "check_run",
            "check_suite",
            "pull_request",
            "push"
          ]
        },
        "pull_requests": [
          {
            "url": "https://api.github.com/repos/omited/pulls/92",
            "id": 1044860019,
            "number": 92,
            "head": {
              "ref": "CICDtest",
              "sha": "258de5a0c766e32a5043a9acf7e83fc5a820b995",
              "repo": {
                "id": 475991000,
                "url": "https://api.github.com/repos/omited",
                "name": "erp-system"
              }
            },
            "base": {
              "ref": "master",
              "sha": "07a9deacc9643ec4f0deb79a771475fc407c37f0",
              "repo": {
                "id": 475991000,
                "url": "https://api.github.com/repos/omited",
                "name": "erp-system"
              }
            }
          }
        ]
      },
      {
        "id": 8154831275,
        "name": "test",
        "node_id": "CR_kwDOHF8L2M8AAAAB5hDZqw",
        "head_sha": "e97ebb905a1642df07a9f58792e3465ef7bb6a91",
        "external_id": "5264e576-3c6f-51f6-f055-fab409685f20",
        "url": "https://api.github.com/repos/omited/check-runs/8154831275",
        "html_url": "https://github.com/omited/runs/8154831275?check_suite_focus=true",
        "details_url": "https://github.com/omited/runs/8154831275?check_suite_focus=true",
        "status": "completed",
        "conclusion": "failure",
        "started_at": "2022-09-02T11:10:23Z",
        "completed_at": "2022-09-02T11:15:04Z",
        "output": {
          "title": null,
          "summary": null,
          "text": null,
          "annotations_count": 1,
          "annotations_url": "https://api.github.com/repos/omited/check-runs/8154831275/annotations"
        },
        "check_suite": {
          "id": 8106627254
        },
        "app": {
          "id": 15368,
          "slug": "github-actions",
          "node_id": "MDM6QXBwMTUzNjg=",
          "owner": {
            "login": "github",
            "id": 9919,
            "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
            "avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
            "gravatar_id": "",
            "url": "https://api.github.com/users/github",
            "html_url": "https://github.com/github",
            "followers_url": "https://api.github.com/users/github/followers",
            "following_url": "https://api.github.com/users/github/following{/other_user}",
            "gists_url": "https://api.github.com/users/github/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/github/subscriptions",
            "organizations_url": "https://api.github.com/users/github/orgs",
            "repos_url": "https://api.github.com/users/github/repos",
            "events_url": "https://api.github.com/users/github/events{/privacy}",
            "received_events_url": "https://api.github.com/users/github/received_events",
            "type": "Organization",
            "site_admin": false
          },
          "name": "GitHub Actions",
          "description": "Automate your workflow from idea to production",
          "external_url": "https://help.github.com/en/actions",
          "html_url": "https://github.com/apps/github-actions",
          "created_at": "2018-07-30T09:30:17Z",
          "updated_at": "2019-12-10T19:04:12Z",
          "permissions": {
            "actions": "write",
            "administration": "read",
            "checks": "write",
            "contents": "write",
            "deployments": "write",
            "discussions": "write",
            "issues": "write",
            "merge_queues": "write",
            "metadata": "read",
            "packages": "write",
            "pages": "write",
            "pull_requests": "write",
            "repository_hooks": "write",
            "repository_projects": "write",
            "security_events": "write",
            "statuses": "write",
            "vulnerability_alerts": "read"
          },
          "events": [
            "branch_protection_rule",
            "check_run",
            "check_suite",
            "create",
            "delete",
            "deployment",
            "deployment_status",
            "discussion",
            "discussion_comment",
            "fork",
            "gollum",
            "issues",
            "issue_comment",
            "label",
            "merge_group",
            "milestone",
            "page_build",
            "project",
            "project_card",
            "project_column",
            "public",
            "pull_request",
            "pull_request_review",
            "pull_request_review_comment",
            "push",
            "registry_package",
            "release",
            "repository",
            "repository_dispatch",
            "status",
            "watch",
            "workflow_dispatch",
            "workflow_run"
          ]
        },
        "pull_requests": [
          {
            "url": "",
            "id": 1044860019,
            "number": 92,
            "head": {
              "ref": "CICDtest",
              "sha": "258de5a0c766e32a5043a9acf7e83fc5a820b995",
              "repo": {
                "id": 475991000,
                "url": "",
                "name": "erp-system"
              }
            },
            "base": {
              "ref": "master",
              "sha": "07a9deacc9643ec4f0deb79a771475fc407c37f0",
              "repo": {
                "id": 475991000,
                "url": "",
                "name": "erp-system"
              }
            }
          }
        ]
      }
    ]
  }

@ArcticLampyrid
Copy link

ArcticLampyrid commented Sep 6, 2022

I've tried to write such an action on my own.
https://github.com/ArcticLampyrid/action-wait-for-workflow

jobs:
  publish:
    if: startsWith(github.ref, 'refs/tags/v')
    runs-on: ubuntu-latest
    steps:
      - name: Wait for build workflow
        uses: ArcticLampyrid/action-wait-for-workflow@v1
        with:
          workflow: build.yml
          sha: ${{ github.sha }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants