Skip to content

Commit 6eae3ee

Browse files
committed
Make dynamic. Use sed.
Fixes #62811. git-svn-id: https://develop.svn.wordpress.org/trunk@59634 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 94d1089 commit 6eae3ee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/workflows/cleanup-pull-requests.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
${{ github.event.head_commit.message }}
5050
EOF
5151
)
52-
echo "fixed_list=$(echo \"$COMMIT_MESSAGE\" | grep -oP '(?<=Fixes )#\d+(, #\d+)*' | grep -oP '\d+' | tr '\n' ' ')" >> $GITHUB_OUTPUT
52+
echo "fixed_list=$(echo \"$COMMIT_MESSAGE\" | sed -n 's/.*Fixes #\([0-9]\+\).*/\1/p' | tr '\n' ' ')" >> $GITHUB_OUTPUT
5353
5454
- name: Get the SVN revision
5555
id: git-svn-id
@@ -58,8 +58,7 @@ jobs:
5858
${{ github.event.head_commit.message }}
5959
EOF
6060
)
61-
SVN_REVISION=$(echo "$COMMIT_MESSAGE" | sed -n 's/.*git-svn-id: https:\/\/develop.svn.wordpress.org\/[^@]*@\([0-9]*\) .*/\1/p')
62-
echo "svn_revision_number=${SVN_REVISION}" >> $GITHUB_OUTPUT
61+
echo "svn_revision_number=$(echo \"$COMMIT_MESSAGE\" | sed -n 's/.*git-svn-id: https:\/\/develop.svn.wordpress.org\/[^@]*@\([0-9]*\) .*/\1/p')" >> $GITHUB_OUTPUT
6362
6463
- name: Find pull requests
6564
id: linked-prs
@@ -72,7 +71,7 @@ jobs:
7271
let prNumbers = [];
7372
7473
for (const ticket of fixedList) {
75-
const query = 'is:pr is:open repo:desrosj/wordpress-develop in:body https://core.trac.wordpress.org/ticket/' + ticket;
74+
const query = 'is:pr is:open repo:' + context.repo.owner + '/' + context.repo.repo + ' in:body https://core.trac.wordpress.org/ticket/' + ticket;
7675
const result = await github.rest.search.issuesAndPullRequests({ q: query });
7776
7877
prNumbers = prNumbers.concat(result.data.items.map(pr => pr.number));

0 commit comments

Comments
 (0)