Skip to content

Commit c647ce7

Browse files
Merge pull request #2575 from Accenture/develop
9.0.3
2 parents bf7f16d + 09f8a79 commit c647ce7

43 files changed

Lines changed: 1629 additions & 265 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pr-labeler.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
enhancement: ['feature/*', 'feat/*']
2-
bug: ['bugfix/*', 'bug/*', 'fix/*', 'hotfix/*']
3-
chore: ['chore/*', 'task/*']
1+
enhancement: ['feature/*', 'feat/*', 'copilot/feature/*']
2+
bug: ['bugfix/*', 'bug/*', 'fix/*', 'hotfix/*', 'copilot/bug/*']
3+
chore: ['chore/*', 'task/*', 'copilot/task/*']

.github/workflows/npm-publish.yml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
types: [published]
99

1010
permissions:
11-
id-token: write # Required for OIDC
12-
contents: read
11+
id-token: write # Required for OIDC
12+
contents: read
1313

1414
jobs:
1515
build:
@@ -34,3 +34,52 @@ jobs:
3434
registry-url: https://registry.npmjs.org/
3535
- run: npm publish
3636

37+
- name: Close release milestone if empty
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
REPO: ${{ github.repository }}
41+
RELEASE_TAG: ${{ github.event.release.tag_name }}
42+
run: |
43+
set -euo pipefail
44+
45+
owner="${REPO%%/*}"
46+
repo="${REPO##*/}"
47+
48+
milestone_title="${RELEASE_TAG#v}"
49+
50+
if [ -z "${milestone_title}" ]; then
51+
echo "Could not parse milestone version from release tag (tag=${RELEASE_TAG})."
52+
exit 0
53+
fi
54+
55+
milestones_json="$(gh api "repos/${owner}/${repo}/milestones?state=open&per_page=100")"
56+
57+
milestone_number="$(echo "$milestones_json" | jq -r \
58+
--arg milestone_title "$milestone_title" \
59+
'.[] | select(.title == $milestone_title) | .number' \
60+
| head -n1)"
61+
62+
if [ -z "${milestone_number}" ] || [ "${milestone_number}" = "null" ]; then
63+
echo "No matching open milestone found for parsed version '${milestone_title}'."
64+
exit 0
65+
fi
66+
67+
milestone="$(gh api "repos/${owner}/${repo}/milestones/${milestone_number}")"
68+
state="$(echo "$milestone" | jq -r '.state')"
69+
open_issues="$(echo "$milestone" | jq -r '.open_issues')"
70+
title="$(echo "$milestone" | jq -r '.title')"
71+
72+
echo "Matched milestone #${milestone_number} '${title}' (state=${state}, open_issues=${open_issues})."
73+
74+
if [ "$state" != "open" ]; then
75+
echo "Milestone is already closed. Nothing to do."
76+
exit 0
77+
fi
78+
79+
if [ "$open_issues" -ne 0 ]; then
80+
echo "Milestone has open items. Skipping close."
81+
exit 0
82+
fi
83+
84+
gh api -X PATCH "repos/${owner}/${repo}/milestones/${milestone_number}" -f state="closed" >/dev/null
85+
echo "Milestone #${milestone_number} closed."
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Sync Milestone from Issue
2+
on:
3+
pull_request:
4+
types: [opened, edited, reopened]
5+
6+
jobs:
7+
sync-milestone:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: read
11+
pull-requests: write
12+
steps:
13+
- name: Sync Milestone
14+
env:
15+
GH_TOKEN: ${{ github.token }}
16+
PR_NUMBER: ${{ github.event.pull_request.number }}
17+
REPO: ${{ github.repository }}
18+
OWNER: ${{ github.repository_owner }}
19+
run: |
20+
# 1. Get the milestone of the officially linked issues and the PR's current milestone via GraphQL
21+
# This catches issues linked via "Fixes #123" and similar in the body or the UI sidebar.
22+
API_RESPONSE=$(gh api graphql -f query='
23+
query($owner: String!, $name: String!, $pr: Int!) {
24+
repository(owner: $owner, name: $name) {
25+
pullRequest(number: $pr) {
26+
milestone {
27+
number
28+
}
29+
closingIssuesReferences(first: 1) {
30+
nodes {
31+
milestone {
32+
number
33+
title
34+
}
35+
}
36+
}
37+
}
38+
}
39+
}' -F owner="$OWNER" -F name="${REPO#*/}" -F pr=$PR_NUMBER)
40+
41+
MILESTONE_NUMBER=$(echo "$API_RESPONSE" | jq -r '.data.repository.pullRequest.closingIssuesReferences.nodes[0].milestone.number // "null"')
42+
MILESTONE_TITLE=$(echo "$API_RESPONSE" | jq -r '.data.repository.pullRequest.closingIssuesReferences.nodes[0].milestone.title // "null"')
43+
CURRENT_PR_MILESTONE=$(echo "$API_RESPONSE" | jq -r '.data.repository.pullRequest.milestone.number // "null"')
44+
45+
# 2. Check if a milestone was found
46+
if [ "$MILESTONE_NUMBER" != "null" ] && [ -n "$MILESTONE_NUMBER" ]; then
47+
if [ "$MILESTONE_NUMBER" = "$CURRENT_PR_MILESTONE" ]; then
48+
echo "PR already has milestone '$MILESTONE_TITLE' set. No update needed."
49+
else
50+
echo "Found milestone '$MILESTONE_TITLE' from linked issue. Assigning to PR..."
51+
gh pr edit $PR_NUMBER --milestone "$MILESTONE_TITLE" --repo "$REPO"
52+
fi
53+
else
54+
echo "No milestone found on linked issues or no issues linked."
55+
fi

.husky/post-checkout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
# ### git commit message template ###
33
git config commit.template .git/templatemessage
4-
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '^((feature|bug|bugfix|fix|hotfix|task|chore)\/)?\K\d{1,7}' || true`
4+
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '^((copilot\/)?(feature|bug|bugfix|fix|hotfix|task|chore)\/)?\K\d{1,7}' || true`
55
if [ -z "$TICKETID" ]
66
then
77
TICKETID="0"

@types/lib/Retriever.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@types/lib/metadataTypes/DataExtension.d.ts

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@types/lib/metadataTypes/DataExtension.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@types/lib/metadataTypes/DataExtensionField.d.ts

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@types/lib/metadataTypes/DataExtensionField.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@types/lib/metadataTypes/Filter.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)