Skip to content

Commit 37d70ea

Browse files
Merge pull request #184 from SingularityNET-Archive:development
feat: Enhance workflow to update README with latest archive data timestamp and improve commit logic
2 parents 768293a + b8cd8bb commit 37d70ea

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

.github/workflows/commit-meeting-summaries.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Commit Meeting Summaries
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 0 * * *' # Run daily at midnight
6+
- cron: "0 0 * * *" # Run daily at midnight
7+
permissions:
8+
contents: write
79
jobs:
810
commit-meeting-summaries:
911
runs-on: ubuntu-latest
@@ -33,4 +35,32 @@ jobs:
3335
else
3436
echo "Error updating meeting summaries by ID"
3537
exit 1
36-
fi
38+
fi
39+
- name: Check out repository
40+
uses: actions/checkout@v4
41+
with:
42+
ref: ${{ github.ref }}
43+
fetch-depth: 0
44+
persist-credentials: true
45+
- name: Update README timestamp
46+
run: |
47+
set -e
48+
TS=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
49+
if grep -q '^Archive data last updated at - ' README.md; then
50+
sed -i "s/^Archive data last updated at - .*/Archive data last updated at - ${TS}/" README.md
51+
else
52+
echo "" >> README.md
53+
echo "Archive data last updated at - ${TS}" >> README.md
54+
fi
55+
- name: Commit and push changes
56+
run: |
57+
set -e
58+
git config user.name "github-actions[bot]"
59+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
60+
git add README.md
61+
if git diff --staged --quiet; then
62+
echo "No README changes to commit."
63+
exit 0
64+
fi
65+
git commit -m "docs: update README with latest archive data timestamp [skip ci]"
66+
git push origin HEAD:${GITHUB_REF_NAME}

0 commit comments

Comments
 (0)