Commit Meeting Summaries #392
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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} |