@@ -16,11 +16,12 @@ jobs:
16
16
- name : Checkout repository
17
17
uses : actions/checkout@v2
18
18
19
- # flagged user-visible change: replaced shell script with JS to check <VersionFeature>user-visible change: replaced shell script with JS to check <VersionFeature>
20
- - name : PR's only change is <VersionFeature> in eng/Versions.propsly change is <VersionFeature> in eng/Versions.props
19
+ - name : PR's only change is <VersionFeature> in eng/Versions.props
21
20
uses : actions/github-script@v4
22
21
with :
23
22
script : |
23
+ const otherChangesMessage = "❌ Changes in eng/Versions.props other than <VersionFeature> found";
24
+ const onlyVersionFeatureMessage = "✅ PR's only change is <VersionFeature> in eng/Versions.props";
24
25
const prNumber = context.payload.pull_request.number;
25
26
const { data: files } = await github.pulls.listFiles({
26
27
owner: context.repo.owner,
29
30
});
30
31
// If files other than eng/Versions.props are changed, output message and exit
31
32
if (files.some(file => file.filename !== "eng/Versions.props")) {
32
- console.log("❌ Changes in eng/Versions.props other than <VersionFeature> found" );
33
+ console.log(otherChangesMessage );
33
34
core.exportVariable("only_version_feature_changed", "false");
34
35
return;
35
36
}
@@ -38,16 +39,16 @@ jobs:
38
39
const patchLines = versionsPropsFile.patch.split("\n").filter(l => l.startsWith("+") || l.startsWith("-"));
39
40
for (const line of patchLines) {
40
41
if (!line.includes("<VersionFeature>")) {
41
- console.log("❌ Changes in eng/Versions.props other than <VersionFeature> found" );
42
+ console.log(otherChangesMessage );
42
43
core.exportVariable("only_version_feature_changed", "false");
43
44
return;
44
45
}
45
46
}
46
- console.log("✅ PR's only change is <VersionFeature> in eng/Versions.props" );
47
+ console.log(onlyVersionFeatureMessage );
47
48
core.exportVariable("only_version_feature_changed", "true");
48
49
49
50
- name : Remove Branch Lockdown label from other PRs targeting this branch
50
- if : steps.PR_has_Branding_label.outputs.has_branding_label == 'true' && steps. PR_only_change_is_VersionFeature_in_eng_Versions_props.outputs.only_version_feature_changed == 'true'
51
+ if : steps.PR_only_change_is_VersionFeature_in_eng_Versions_props.outputs.only_version_feature_changed == 'true'
51
52
uses : actions/github-script@v4
52
53
with :
53
54
script : |
0 commit comments