-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update super-linter/super-linter action to v6.8.0 * super-linterによる指摘事項修正 * prettierを使う * gitleaksをアップデートしてあげたよ! (#1527) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
69e8e76
commit e033a87
Showing
4 changed files
with
37 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/zricethezav/gitleaks | ||
rev: v8.18.3 | ||
rev: v8.18.4 | ||
hooks: | ||
- id: gitleaks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,48 @@ | ||
module.exports = async ({ github, context }) => { | ||
let latestReleaseVersion = '' | ||
let latestReleaseVersion = ""; | ||
|
||
try { | ||
const getLatestReleaseParams = { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo | ||
} | ||
console.log('call repos.getLatestRelease:', getLatestReleaseParams) | ||
const latestRelease = await github.rest.repos.getLatestRelease(getLatestReleaseParams) | ||
latestReleaseVersion = latestRelease.data.tag_name | ||
repo: context.repo.repo, | ||
}; | ||
console.log("call repos.getLatestRelease:", getLatestReleaseParams); | ||
const latestRelease = await github.rest.repos.getLatestRelease( | ||
getLatestReleaseParams, | ||
); | ||
latestReleaseVersion = latestRelease.data.tag_name; | ||
} catch (e) { | ||
if (e.status === 404) { | ||
latestReleaseVersion = 'v0.0.0' | ||
latestReleaseVersion = "v0.0.0"; | ||
} else { | ||
throw e | ||
throw e; | ||
} | ||
} | ||
|
||
const listPullRequestsAssociatedWithCommitParams = { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
commit_sha: process.env.SHA | ||
} | ||
console.log('call repos.listPullRequestsAssociatedWithCommit:', listPullRequestsAssociatedWithCommitParams) | ||
commit_sha: process.env.SHA, | ||
}; | ||
console.log( | ||
"call repos.listPullRequestsAssociatedWithCommit:", | ||
listPullRequestsAssociatedWithCommitParams, | ||
); | ||
const pulls = await github.paginate( | ||
github.rest.repos.listPullRequestsAssociatedWithCommit, | ||
listPullRequestsAssociatedWithCommitParams | ||
) | ||
const labels = pulls.flatMap(p => p.labels.map(l => l.name)) | ||
const tagNames = latestReleaseVersion.split('.') | ||
let version | ||
listPullRequestsAssociatedWithCommitParams, | ||
); | ||
const labels = pulls.flatMap((p) => p.labels.map((l) => l.name)); | ||
const tagNames = latestReleaseVersion.split("."); | ||
let version; | ||
|
||
if (labels.includes('major release')) { | ||
version = [`v${Number(tagNames[0].replace('v', '')) + 1}`, 0, 0] | ||
} else if (labels.includes('minor release')) { | ||
version = [tagNames[0], Number(tagNames[1]) + 1, 0] | ||
if (labels.includes("major release")) { | ||
version = [`v${Number(tagNames[0].replace("v", "")) + 1}`, 0, 0]; | ||
} else if (labels.includes("minor release")) { | ||
version = [tagNames[0], Number(tagNames[1]) + 1, 0]; | ||
} else { | ||
version = [tagNames[0], tagNames[1], Number(tagNames[2]) + 1] | ||
version = [tagNames[0], tagNames[1], Number(tagNames[2]) + 1]; | ||
} | ||
|
||
return version.join('.') | ||
} | ||
return version.join("."); | ||
}; |