Skip to content

Commit 42c2896

Browse files
committed
fix(ci): address label related on merge
1 parent cce932c commit 42c2896

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

.github/scripts/label_related_issue.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module.exports = async ({github, context, core}) => {
33
const prNumber = process.env.PR_NUMBER;
44
const releaseLabel = process.env.RELEASE_LABEL;
55
const maintainersTeam = process.env.MAINTAINERS_TEAM;
6-
core.info(prBody);
76
const RELATED_ISSUE_REGEX = /Issue number:[^\d\r\n]+(?<issue>\d+)/;
87

8+
core.info(prBody);
99
const isMatch = RELATED_ISSUE_REGEX.exec(prBody);
1010
if (!isMatch) {
1111
core.setFailed(`Unable to find related issue for PR number ${prNumber}.\n\n Body details: ${prBody}`);
@@ -18,8 +18,6 @@ module.exports = async ({github, context, core}) => {
1818
}
1919

2020
const { groups: {relatedIssueNumber} } = isMatch
21-
core.setInfo(isMatch);
22-
console.dir(isMatch, {depth: null});
2321

2422
core.info(`Auto-labeling related issue ${relatedIssueNumber} for release`)
2523
return await github.rest.issues.addLabels({

.github/workflows/on_merged_pr.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
release_label_on_merge:
2222
needs: get_pr_details
2323
# Maintenance: Conditional isn't working as expected
24-
# if: |
25-
# needs.get_pr_details.outputs.prAuthor != 'dependabot[bot]'
26-
# && needs.get_pr_details.outputs.prIsMerged == true
24+
if: |
25+
needs.get_pr_details.outputs.prAuthor != 'dependabot[bot]'
26+
&& needs.get_pr_details.outputs.prIsMerged == true
2727
runs-on: ubuntu-latest
2828
steps:
2929
- uses: actions/checkout@v3

.github/workflows/on_opened_pr.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ jobs:
2222
check_related_issue:
2323
needs: get_pr_details
2424
# Maintenance: Refactor condition to the correct env syntax later
25-
if: >
26-
${{ needs.get_pr_details.outputs.prAction == 'opened' &&
27-
contains(fromJson('["dependabot[bot]", "markdownify[bot]"]'), needs.get_pr_details.outputs.prAuthor) != true
28-
}}
25+
if: |
26+
needs.get_pr_details.outputs.prAction == 'opened'
27+
&& contains(fromJson('["dependabot[bot]", "markdownify[bot]"]'), needs.get_pr_details.outputs.prAuthor) != true
2928
runs-on: ubuntu-latest
3029
steps:
3130
- uses: actions/checkout@v3

0 commit comments

Comments
 (0)