-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (66 loc) · 2.68 KB
/
commit-meeting-summaries.yml
File metadata and controls
66 lines (66 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# .github/workflows/commit-meeting-summaries.yml
name: Commit Meeting Summaries
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Run daily at midnight
permissions:
contents: write
jobs:
commit-meeting-summaries:
runs-on: ubuntu-latest
steps:
- name: Update Meeting Summaries Array
env:
NETLIFY_BASE_URL: ${{ secrets.NETLIFY_BASE_URL }}
run: |
response=$(curl -s -X POST -H "Content-Type: application/json" "${NETLIFY_BASE_URL}/.netlify/functions/batchUpdateMeetingSummariesArray")
echo "Response from batchUpdateMeetingSummariesArray: $response"
# Check if the response indicates success
if echo "$response" | grep -qE '\{"message":\s*"Meeting summaries updated successfully"\}'; then
echo "Meeting summaries array updated successfully"
else
echo "Error updating meeting summaries array"
exit 1
fi
- name: Update Meeting Summaries by ID
env:
NETLIFY_BASE_URL: ${{ secrets.NETLIFY_BASE_URL }}
run: |
response=$(curl -s -X POST -H "Content-Type: application/json" "${NETLIFY_BASE_URL}/.netlify/functions/batchUpdateMeetingSummariesById")
echo "Response from batchUpdateMeetingSummariesById: $response"
# Check if the response indicates success
if echo "$response" | grep -qE '\{"message":\s*"Meeting summaries updated successfully"\}'; then
echo "Meeting summaries by ID updated successfully"
else
echo "Error updating meeting summaries by ID"
exit 1
fi
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
persist-credentials: true
- name: Update README timestamp
run: |
set -e
TS=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
if grep -q '^Archive data last updated at - ' README.md; then
sed -i "s/^Archive data last updated at - .*/Archive data last updated at - ${TS}/" README.md
else
echo "" >> README.md
echo "Archive data last updated at - ${TS}" >> README.md
fi
- name: Commit and push changes
run: |
set -e
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
if git diff --staged --quiet; then
echo "No README changes to commit."
exit 0
fi
git commit -m "docs: update README with latest archive data timestamp [skip ci]"
git push origin HEAD:${GITHUB_REF_NAME}