Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
diekotto committed Nov 19, 2024
1 parent a971e05 commit 4ce9155
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23851,18 +23851,27 @@ var require_action = __commonJS({
async function run2() {
try {
const token = core.getInput("token");
const repository = core.getInput("repository");
const eventType = core.getInput("event-type");
const clientPayload = JSON.parse(core.getInput("client-payload"));
const [owner, repo] = repository.split("/");
const octokit = github.getOctokit(token);
await octokit.rest.repos.createDispatchEvent({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
owner,
repo,
event_type: eventType,
client_payload: clientPayload
client_payload: JSON.parse(clientPayload)
});
core.info(`Successfully triggered ${eventType} event`);
} catch (error) {
core.setFailed(`Action failed with error: ${error}`);
core.debug(inspect(error));
if (hasErrorStatus(error) && error.status == 404) {
core.setFailed(
"Repository not found, OR token has insufficient permissions."
);
} else {
core.setFailed(getErrorMessage(error));
}
}
}
module2.exports = { run: run2 };
Expand Down

0 comments on commit 4ce9155

Please sign in to comment.