Dyskusje » Tworzenie skryptów

Can't update script by Github release.

§
Napisano: 10-02-2022

I create a release, and webhook triggered.
But webhook response is No commits found in this push.
How to fix this?

§
Napisano: 11-02-2022

Can you provide the content of the webhook request?

§
Napisano: 13-02-2022
Edytowano: 13-02-2022

Can you provide the content of the webhook request?

OK, This is the content of the webhook request.

It looks like no commits field?

How to add commits to the content of the webhook request?

{
  "action": "published",
  "release": {
    "url": "https://api.github.com/repos/uyloal/search-block/releases/59190638",
    "assets_url": "https://api.github.com/repos/uyloal/search-block/releases/59190638/assets",
    "upload_url": "https://uploads.github.com/repos/uyloal/search-block/releases/59190638/assets{?name,label}",
    "html_url": "https://github.com/uyloal/search-block/releases/tag/v0.1.1",
    "id": 59190638,
    "author": {
      "login": "uyloal",
      "id": 37807381,
      "node_id": "MDQ6VXNlcjM3ODA3Mzgx",
      "avatar_url": "https://avatars.githubusercontent.com/u/37807381?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/uyloal",
      "html_url": "https://github.com/uyloal",
      "followers_url": "https://api.github.com/users/uyloal/followers",
      "following_url": "https://api.github.com/users/uyloal/following{/other_user}",
      "gists_url": "https://api.github.com/users/uyloal/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/uyloal/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/uyloal/subscriptions",
      "organizations_url": "https://api.github.com/users/uyloal/orgs",
      "repos_url": "https://api.github.com/users/uyloal/repos",
      "events_url": "https://api.github.com/users/uyloal/events{/privacy}",
      "received_events_url": "https://api.github.com/users/uyloal/received_events",
      "type": "User",
      "site_admin": false
    },
    "node_id": "RE_kwDOG0Eh4c4Dhy1u",
    "tag_name": "v0.1.1",
    "target_commitish": "main",
    "name": "Release v0.1.1",
    "draft": false,
    "prerelease": false,
    "created_at": "2022-02-10T02:05:39Z",
    "published_at": "2022-02-10T02:06:59Z",
    "assets": [

    ],
    "tarball_url": "https://api.github.com/repos/uyloal/search-block/tarball/v0.1.1",
    "zipball_url": "https://api.github.com/repos/uyloal/search-block/zipball/v0.1.1",
    "body": "### Add MIT license"
  },
  "repository": {
    "id": 457253345,
    "node_id": "R_kgDOG0Eh4Q",
    "name": "search-block",
    "full_name": "uyloal/search-block",
    "private": false,
    "owner": {
      "login": "uyloal",
      "id": 37807381,
      "node_id": "MDQ6VXNlcjM3ODA3Mzgx",
      "avatar_url": "https://avatars.githubusercontent.com/u/37807381?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/uyloal",
      "html_url": "https://github.com/uyloal",
      "followers_url": "https://api.github.com/users/uyloal/followers",
      "following_url": "https://api.github.com/users/uyloal/following{/other_user}",
      "gists_url": "https://api.github.com/users/uyloal/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/uyloal/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/uyloal/subscriptions",
      "organizations_url": "https://api.github.com/users/uyloal/orgs",
      "repos_url": "https://api.github.com/users/uyloal/repos",
      "events_url": "https://api.github.com/users/uyloal/events{/privacy}",
      "received_events_url": "https://api.github.com/users/uyloal/received_events",
      "type": "User",
      "site_admin": false
    },
    "html_url": "https://github.com/uyloal/search-block",
    "description": "自动屏蔽搜索结果中某些网站的脚本",
    "fork": false,
    "url": "https://api.github.com/repos/uyloal/search-block",
    "forks_url": "https://api.github.com/repos/uyloal/search-block/forks",
    "keys_url": "https://api.github.com/repos/uyloal/search-block/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/uyloal/search-block/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/uyloal/search-block/teams",
    "hooks_url": "https://api.github.com/repos/uyloal/search-block/hooks",
    "issue_events_url": "https://api.github.com/repos/uyloal/search-block/issues/events{/number}",
    "events_url": "https://api.github.com/repos/uyloal/search-block/events",
    "assignees_url": "https://api.github.com/repos/uyloal/search-block/assignees{/user}",
    "branches_url": "https://api.github.com/repos/uyloal/search-block/branches{/branch}",
    "tags_url": "https://api.github.com/repos/uyloal/search-block/tags",
    "blobs_url": "https://api.github.com/repos/uyloal/search-block/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/uyloal/search-block/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/uyloal/search-block/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/uyloal/search-block/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/uyloal/search-block/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/uyloal/search-block/languages",
    "stargazers_url": "https://api.github.com/repos/uyloal/search-block/stargazers",
    "contributors_url": "https://api.github.com/repos/uyloal/search-block/contributors",
    "subscribers_url": "https://api.github.com/repos/uyloal/search-block/subscribers",
    "subscription_url": "https://api.github.com/repos/uyloal/search-block/subscription",
    "commits_url": "https://api.github.com/repos/uyloal/search-block/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/uyloal/search-block/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/uyloal/search-block/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/uyloal/search-block/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/uyloal/search-block/contents/{+path}",
    "compare_url": "https://api.github.com/repos/uyloal/search-block/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/uyloal/search-block/merges",
    "archive_url": "https://api.github.com/repos/uyloal/search-block/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/uyloal/search-block/downloads",
    "issues_url": "https://api.github.com/repos/uyloal/search-block/issues{/number}",
    "pulls_url": "https://api.github.com/repos/uyloal/search-block/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/uyloal/search-block/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/uyloal/search-block/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/uyloal/search-block/labels{/name}",
    "releases_url": "https://api.github.com/repos/uyloal/search-block/releases{/id}",
    "deployments_url": "https://api.github.com/repos/uyloal/search-block/deployments",
    "created_at": "2022-02-09T07:28:22Z",
    "updated_at": "2022-02-09T08:02:39Z",
    "pushed_at": "2022-02-10T02:05:43Z",
    "git_url": "git://github.com/uyloal/search-block.git",
    "ssh_url": "[email protected]:uyloal/search-block.git",
    "clone_url": "https://github.com/uyloal/search-block.git",
    "svn_url": "https://github.com/uyloal/search-block",
    "homepage": null,
    "size": 3,
    "stargazers_count": 0,
    "watchers_count": 0,
    "language": "JavaScript",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 0,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 0,
    "license": {
      "key": "mit",
      "name": "MIT License",
      "spdx_id": "MIT",
      "url": "https://api.github.com/licenses/mit",
      "node_id": "MDc6TGljZW5zZTEz"
    },
    "allow_forking": true,
    "is_template": false,
    "topics": [

    ],
    "visibility": "public",
    "forks": 0,
    "open_issues": 0,
    "watchers": 0,
    "default_branch": "main"
  },
  "sender": {
    "login": "uyloal",
    "id": 37807381,
    "node_id": "MDQ6VXNlcjM3ODA3Mzgx",
    "avatar_url": "https://avatars.githubusercontent.com/u/37807381?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/uyloal",
    "html_url": "https://github.com/uyloal",
    "followers_url": "https://api.github.com/users/uyloal/followers",
    "following_url": "https://api.github.com/users/uyloal/following{/other_user}",
    "gists_url": "https://api.github.com/users/uyloal/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/uyloal/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/uyloal/subscriptions",
    "organizations_url": "https://api.github.com/users/uyloal/orgs",
    "repos_url": "https://api.github.com/users/uyloal/repos",
    "events_url": "https://api.github.com/users/uyloal/events{/privacy}",
    "received_events_url": "https://api.github.com/users/uyloal/received_events",
    "type": "User",
    "site_admin": false
  }
}
§
Napisano: 19-02-2022

The error message here is misleading. It's just saying that it can't find what script it's related to. I've updated the message to say something more appropriate for a release event.

The problem seems to be because your script used the https://raw.githubusercontent.com format URL rather than https://github.com/org/repo/raw format. I've updated the code to be able to handle this on release events (it already does handle it for push events).

Odpowiedz

Zaloguj się, by odpowiedzieć.