You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changelogger: automatically create a changelog entry from info extracted from PR description (#1456)
* Split the changelog check workflow into 2 steps
It will make it easier to insert another step to get data from the PR description.
* Update Pull Request template to include changelog fields
* Allow the workflow to run when PR is edited (description changed)
* Add new step to extract changelog info from PR body
* Create a changelog file from the PR description
* Add changelog
* Add newlines before changelog message description
core.debug( `Changelog check: Get list of files modified in ${ owner }/${ repo } #${ number }.` );
34
46
35
47
const fileList = [];
@@ -58,7 +70,127 @@ jobs:
58
70
59
71
if ( hasChangelogFile ) {
60
72
core.info( `PR #${ number } includes a changelog file.` );
73
+
core.setOutput('has-changelog-file', 'true');
61
74
} else {
62
75
core.info( `PR #${ number } does not include a changelog file.` );
63
-
core.setFailed( 'Your PR does not include a changelog file. Please add a changelog entry by running `composer changelog:add`, checking in the resulting file, and pushing that change to your branch.' );
76
+
core.setOutput('has-changelog-file', 'false');
77
+
}
78
+
79
+
- name: "Check for changelog information in PR body"
core.info( `PR #${ number } has no description.` );
90
+
core.setFailed( 'Your PR does not include a changelog file and has no description to extract changelog information from. Please generate a changelog entry manually by running `composer changelog:add`.' );
91
+
return;
92
+
}
93
+
94
+
// Check if the "Automatically create a changelog entry" checkbox is checked.
const isAutoCreateChecked = autoCreateRegex.test( body );
97
+
98
+
if (! isAutoCreateChecked ) {
99
+
core.info( `PR #${ number } does not have the "Automatically create a changelog entry" checkbox checked.` );
100
+
core.setFailed( 'Your PR does not include a changelog file, and does not have the "Automatically create a changelog entry" checkbox checked. Please check the "Automatically create a changelog entry" checkbox and fill in all required information.' );
101
+
return;
102
+
}
103
+
104
+
core.info( `PR #${ number } has the "Automatically create a changelog entry" checkbox checked. Checking for changelog details...` );
core.setFailed( 'Your PR is missing one or more required sections in the changelog details. Please generate a changelog entry manually by running `composer changelog:add`.' );
0 commit comments