Skip to content

Commit

Permalink
fix URLs in summary for scheduled workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
acidghost committed Oct 10, 2024
1 parent dea2b73 commit c96278d
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,7 @@ if (!supportedEvents.includes(eventType)) {
}

// Determine if the github user is an individual or an organization
let githubUsername = "";

// eventJSON.repository is undefined for scheduled events
if (eventType == "schedule") {
githubUsername = process.env.GITHUB_REPOSITORY_OWNER;
eventJSON.repository = {
owner: {
login: process.env.GITHUB_REPOSITORY_OWNER,
},
full_name: process.env.GITHUB_REPOSITORY,
};
let repoName = process.env.GITHUB_REPOSITORY;
repoName = repoName.replace(`${process.env.GITHUB_REPOSITORY_OWNER}/`, "");
// update repo name
process.env.GITHUB_REPOSITORY = repoName;
} else {
githubUsername = eventJSON.repository.owner.login;
}
const githubUsername = eventJSON.repository.owner.login;

const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
Expand Down

0 comments on commit c96278d

Please sign in to comment.