Skip to content

Commit 3e398af

Browse files
committed
try ci workflow
1 parent bbb9121 commit 3e398af

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Update Last Updated Date
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches:
7+
- main
8+
9+
jobs:
10+
update-last-updated:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.head_ref }}
20+
fetch-depth: 0
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Get changed MDX files
24+
id: changed-files
25+
uses: tj-actions/changed-files@v45
26+
with:
27+
files: |
28+
**/*.mdx
29+
30+
- name: Update last-updated frontmatter
31+
if: steps.changed-files.outputs.any_changed == 'true'
32+
run: |
33+
# Get current date in "Month Day, Year" format
34+
CURRENT_DATE=$(date +"%B %-d, %Y")
35+
echo "Current date: $CURRENT_DATE"
36+
37+
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
38+
echo "Processing: $file"
39+
40+
if [ ! -f "$file" ]; then
41+
echo "File not found, skipping: $file"
42+
continue
43+
fi
44+
45+
# Check if file has frontmatter (starts with ---)
46+
if ! head -1 "$file" | grep -q "^---"; then
47+
echo "No frontmatter found, skipping: $file"
48+
continue
49+
elif grep -q "^last-updated:" "$file"; then
50+
echo "Updating existing last-updated field"
51+
# Update existing last-updated field
52+
sed -i "s/^last-updated:.*$/last-updated: $CURRENT_DATE/" "$file"
53+
else
54+
echo "Adding last-updated field to existing frontmatter"
55+
# Add last-updated after the opening ---
56+
sed -i "0,/^---$/!{0,/^---$/b;s/^---$/last-updated: $CURRENT_DATE\n---/}" "$file"
57+
# If the above didn't work (complex sed), try awk
58+
if ! grep -q "^last-updated:" "$file"; then
59+
awk -v date="$CURRENT_DATE" '
60+
NR==1 && /^---$/ { print; getline; print "last-updated: " date; print; next }
61+
{ print }
62+
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
63+
fi
64+
fi
65+
done
66+
67+
- name: Commit changes
68+
if: steps.changed-files.outputs.any_changed == 'true'
69+
run: |
70+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
71+
git config --local user.name "github-actions[bot]"
72+
git add -A
73+
if git diff --staged --quiet; then
74+
echo "No changes to commit"
75+
else
76+
git commit -m "chore: update last-updated date in MDX files"
77+
git push
78+
fi

fern/products/docs/pages/component-library/default-components/tooltips.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: Tooltip
33
description: Add interactive tooltips to your documentation.
44
---
55

6+
Updated.....
7+
68
The `<Tooltip>` component displays additional information when users hover over text or code elements. Use tooltips to provide context, definitions, or explanations without cluttering your documentation.
79

810
## Usage

fern/products/docs/pages/security/overview.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22
title: Security
33
description: Learn how Fern handles authentication and user credentials in documentation sites.
4+
last-updated: December 9, 2025
45
---
56

7+
Updated.....
8+
69
Fern's documentation platform is built with security as a core principle, using a client-side architecture for authentication and credential handling. User credentials and sensitive data are stored only in browser cookies and never transmitted to Fern's servers.
710

811
<Note title="Security questions">

0 commit comments

Comments
 (0)