Skip to content

Commit 9f97562

Browse files
Merge branch 'cloudflare:production' into krishnprakash/cloudflare-docs
2 parents f2f26f6 + 7215940 commit 9f97562

File tree

64 files changed

+908
-485
lines changed

Some content is hidden

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

64 files changed

+908
-485
lines changed

.github/workflows/comment-changed-filenames.yml renamed to .github/workflows/potential-redirects-or-partials.yml

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Flag changed filenames
1+
name: Potential redirects or partials
22

33
# **What it does**: Adds or removes a comment if a PR renames or removes a file.
44
# **Why we have it**: Highlights when we need redirects covering certain file paths.
@@ -22,7 +22,7 @@ jobs:
2222
- name: Checkout Repository
2323
uses: actions/checkout@v4
2424

25-
- name: Get Renamed or Removed Files from Pull Request
25+
- name: Potential redirects
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
run: |
@@ -37,17 +37,32 @@ jobs:
3737
echo "${files}" >> "$GITHUB_ENV"
3838
echo "${delimiter}" >> "$GITHUB_ENV"
3939
40+
- name: Updated partial files
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
files=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
45+
-H "Accept: application/vnd.github.v3+json" \
46+
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \
47+
jq -r '.[] | select(.status=="modified") | select (.filename | startswith("src/content/partials")) | select(.filename | endswith(".mdx")) | .filename' | \
48+
sed -e 's|^src/content/partials||' -e 's|\.mdx$|/|')
49+
# Use random delimiter for security reasons
50+
delimiter="$(openssl rand -hex 8)"
51+
echo "PARTIAL_FILES<<${delimiter}" >> "$GITHUB_ENV"
52+
echo "${files}" >> "$GITHUB_ENV"
53+
echo "${delimiter}" >> "$GITHUB_ENV"
54+
4055
- name: Comment or Update Comment on PR based on changed files
4156
env:
4257
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4358
run: |
4459
# If there are no changed files
45-
if [ -z "$CHANGED_FILES" ]; then
60+
if [ -z "$CHANGED_FILES" ] && [ -z "$PARTIAL_FILES" ]; then
4661
# Fetch the ID of the existing comment, if it exists
4762
existing_comment_id=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
4863
-H "Accept: application/vnd.github.v3+json" \
4964
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | \
50-
jq '.[] | select(.user.id == 41898282) | select(.body | contains("This PR changes current filenames or deletes current files")) | .id')
65+
jq '.[] | select(.user.id == 41898282) | select(.body | contains("This PR requires additional review attention because it affects the following areas")) | .id')
5166
5267
# If the comment exists, delete it
5368
if [ ! -z "$existing_comment_id" ]; then
@@ -58,18 +73,39 @@ jobs:
5873
fi
5974
else
6075
# Construct the comment body for changed files
61-
comment_body="This PR changes current filenames or deletes current files. Make sure you have [redirects](https://developers.cloudflare.com/pages/configuration/redirects/) set up to cover the following paths:"
62-
for path in $CHANGED_FILES; do
63-
clean_path=$(echo $path | sed 's/"//g') # Remove quotation marks
76+
comment_body="This PR requires additional review attention because it affects the following areas:"
77+
78+
# Add CHANGED_FILES logic
79+
if [ -n "$CHANGED_FILES" ]; then
6480
comment_body="$comment_body
81+
82+
### Redirects
83+
This PR changes current filenames or deletes current files. Make sure you have [redirects](https://developers.cloudflare.com/pages/configuration/redirects/) set up to cover the following paths:"
84+
for path in $CHANGED_FILES; do
85+
clean_path=$(echo "$path" | sed 's/"//g') # Remove quotation marks
86+
comment_body="$comment_body
6587
- [ ] \`$clean_path\`"
66-
done
88+
done
89+
fi
90+
91+
# Conditional bit for PARTIAL_FILES
92+
if [ -n "$PARTIAL_FILES" ]; then
93+
comment_body="$comment_body
94+
95+
### Partials
96+
This PR updates partial files, which are pieces of content used across multiple files in our [Render component](https://developers.cloudflare.com/style-guide/components/render/)."
97+
for path in $PARTIAL_FILES; do
98+
updated_path=$(echo "$path" | sed -e 's/"//g' -e 's/^\///' -e 's/\/$//')
99+
comment_body="$comment_body
100+
- [ ] \`$updated_path\` - [view affected files](https://developers.cloudflare.com/style-guide/components/render/?partial=$updated_path)"
101+
done
102+
fi
67103
68104
# Check if a comment already exists
69105
existing_comment_id=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
70106
-H "Accept: application/vnd.github.v3+json" \
71107
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | \
72-
jq '.[] | select(.user.id == 41898282) | select(.body | contains("This PR changes current filenames or deletes current files")) | .id')
108+
jq '.[] | select(.user.id == 41898282) | select(.body | contains("This PR requires additional review attention because it affects the following areas")) | .id')
73109
74110
comment_payload=$(echo '{}' | jq --arg body "$comment_body" '.body = $body')
75111

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@astrojs/starlight-docsearch": "0.6.0",
3737
"@astrojs/starlight-tailwind": "4.0.1",
3838
"@cloudflare/vitest-pool-workers": "0.8.50",
39-
"@cloudflare/workers-types": "4.20250703.0",
39+
"@cloudflare/workers-types": "4.20250711.0",
4040
"@codingheads/sticky-header": "1.0.2",
4141
"@expressive-code/plugin-collapsible-sections": "0.41.3",
4242
"@floating-ui/react": "0.27.13",
@@ -65,7 +65,7 @@
6565
"dedent": "1.6.0",
6666
"dompurify": "3.2.6",
6767
"dot-prop": "9.0.0",
68-
"eslint": "9.30.1",
68+
"eslint": "9.31.0",
6969
"eslint-plugin-astro": "1.3.1",
7070
"eslint-plugin-jsx-a11y": "6.10.2",
7171
"eslint-plugin-react": "7.37.5",
@@ -98,7 +98,7 @@
9898
"react": "19.0.0",
9999
"react-dom": "19.0.0",
100100
"react-icons": "5.5.0",
101-
"react-instantsearch": "7.16.0",
101+
"react-instantsearch": "7.16.1",
102102
"react-markdown": "10.1.0",
103103
"react-select": "5.10.1",
104104
"redirects-in-workers": "0.0.7",

public/__redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@
516516
/cloudflare-one/email-security/setup/post-delivery-deployment/api/office365-api/ /cloudflare-one/email-security/setup/post-delivery-deployment/api/m365-api/ 301
517517
/cloudflare-one/email-security/setup/post-delivery-deployment/bcc-journaling/journaling-setup/office365-journaling/ /cloudflare-one/email-security/setup/post-delivery-deployment/bcc-journaling/journaling-setup/m365-journaling/ 301
518518
/cloudflare-one/email-security/setup/pre-delivery-deployment/prerequisites/microsoft365-email-security-mx/ /cloudflare-one/email-security/setup/pre-delivery-deployment/prerequisites/m365-email-security-mx/ 301
519+
/cloudflare-one/email-security/setup/post-delivery-deployment/bcc-journaling/journaling-setup/manage-domains/ /cloudflare-one/email-security/setup/manage-domains/ 301
519520

520521
# firewall
521522
/firewall/api/cf-lists/ /waf/tools/lists/lists-api/ 301

0 commit comments

Comments
 (0)