Skip to content

Commit

Permalink
super-linterアップデート (#1526)
Browse files Browse the repository at this point in the history
* 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
3 people authored Aug 8, 2024
1 parent 69e8e76 commit e033a87
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 30 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ jobs:
# Run Linter against code base #
################################
- name: Lint Code Base
uses: super-linter/super-linter/slim@v6.7.0
uses: super-linter/super-linter/slim@v6.8.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: main
LINTER_RULES_PATH: .
VALIDATE_JSCPD: false
JAVASCRIPT_DEFAULT_STYLE: prettier
VALIDATE_JAVASCRIPT_STANDARD: false
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
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
10 changes: 5 additions & 5 deletions scripts/action/create_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module.exports = async ({ github, context }) => {
repo: context.repo.repo,
tag_name: process.env.TAG_NAME,
target_commitish: process.env.GITHUB_REF,
generate_release_notes: true
}
console.log('call repos.createRelease:', createReleaseParams)
await github.rest.repos.createRelease(createReleaseParams)
}
generate_release_notes: true,
};
console.log("call repos.createRelease:", createReleaseParams);
await github.rest.repos.createRelease(createReleaseParams);
};
51 changes: 28 additions & 23 deletions scripts/action/increment_version.js
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(".");
};

0 comments on commit e033a87

Please sign in to comment.