mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 21:53:26 +00:00
ci: improve workflow triggers (#2017)
- Unchain commit-lint and CI - Even if a commit does not meet the CI path filter, it still needs to lint the commit message. - Unchain PR filter and CI - The CI workflow needs to be triggered when the commits in a pull request are modified. - Allow manual publishing - Sometimes `semantic-release` will error out due to commit messages referencing discussions, but this does not affect the final RubyGems/GitHub Release. In such cases, manual triggering of the publish process is needed to complete the remaining publishing steps.
This commit is contained in:
10
.github/workflows/scripts/pr-filter.js
vendored
10
.github/workflows/scripts/pr-filter.js
vendored
@@ -1,5 +1,5 @@
|
||||
function hasTypes(markdown) {
|
||||
return /## Type of change/.test(markdown) && /-\s*\[x\]/i.test(markdown);
|
||||
return /## Type of change/.test(markdown) && /-\s\[x\]/i.test(markdown);
|
||||
}
|
||||
|
||||
function hasDescription(markdown) {
|
||||
@@ -9,9 +9,9 @@ function hasDescription(markdown) {
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = async ({ github, context }) => {
|
||||
module.exports = async ({ github, context, core }) => {
|
||||
const pr = context.payload.pull_request;
|
||||
const body = pr.body === null ? '' : pr.body.trim();
|
||||
const body = pr.body === null ? '' : pr.body;
|
||||
const markdown = body.replace(/<!--[\s\S]*?-->/g, '');
|
||||
const action = context.payload.action;
|
||||
|
||||
@@ -31,7 +31,7 @@ module.exports = async ({ github, context }) => {
|
||||
issue_number: pr.number,
|
||||
body: `Oops, it seems you've ${action} an invalid pull request. No worries, we'll close it for you.`
|
||||
});
|
||||
}
|
||||
|
||||
return isValid;
|
||||
core.setFailed('PR content does not meet template requirements.');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user