diff --git a/dist/index.js b/dist/index.js index 6fc8098..98501e5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -9048,19 +9048,22 @@ __nccwpck_require__.r(__webpack_exports__); -run() +run(); async function run() { - try { - // Get inputs - const token = (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput)("token") - const username = (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput)("username") - - result = await (0,_actions_github__WEBPACK_IMPORTED_MODULE_1__.getOctokit)(token).rest.users.follow(username) - } catch (error) { - console.log(error) - ;(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed)(error.message) - } + try { + // Get inputs + const token = (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput)("token"); + const login = (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput)("username"); + + + result = await (0,_actions_github__WEBPACK_IMPORTED_MODULE_1__.getOctokit)(token).rest.users.follow({ + username: login, + }); + } catch (error) { + console.log(error); + (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed)(error.message); + } } })(); diff --git a/index.js b/index.js index 8071eb1..7ee32fe 100644 --- a/index.js +++ b/index.js @@ -1,17 +1,20 @@ -import { getInput, setFailed } from '@actions/core' -import { getOctokit } from '@actions/github' +import { getInput, setFailed } from "@actions/core"; +import { getOctokit } from "@actions/github"; -run() +run(); async function run() { - try { - // Get inputs - const token = getInput("token") - const username = getInput("username") + try { + // Get inputs + const token = getInput("token"); + const login = getInput("username"); - result = await getOctokit(token).rest.users.follow(username) - } catch (error) { - console.log(error) - setFailed(error.message) - } + const result = await getOctokit(token).rest.users.follow({ + username: login, + }); + console.log(result); + } catch (error) { + console.log(error); + setFailed(error.message); + } } diff --git a/package.json b/package.json index 06f2abd..62d019c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/ad2ien/verify-user-membership.git" + "url": "git+https://github.com/ad2ien/follow-contributor-action.git" }, "keywords": [ "github", @@ -18,9 +18,9 @@ "author": "OKP4", "license": "MIT", "bugs": { - "url": "https://github.com/ad2ien/verify-user-membership/issues" + "url": "https://github.com/ad2ien/follow-contributor-action/issues" }, - "homepage": "https://github.com/ad2ien/verify-user-membership#readme", + "homepage": "https://github.com/ad2ien/follow-contributor-action#readme", "dependencies": { "@actions/core": "^1.9.0", "@actions/github": "^5.0.3"