Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions .github/workflows/commit-meeting-summaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,39 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: |
sudo apt-get install -y jq
# Install any other necessary dependencies

- name: Retrieve Meeting Summaries
id: retrieve-summaries
env:
NETLIFY_BASE_URL: ${{ secrets.NETLIFY_BASE_URL }}
run: |
curl -X POST ${{ secrets.NETLIFY_BASE_URL }}/.netlify/functions/getMeetingSummaries \
-H 'Content-Type: application/json' \
-d '{}' \
-o meeting-summaries.json
summaries=$(cat meeting-summaries.json)
summaries="${summaries//$'\n'/''}"
summaries="${summaries//$'\r'/''}"
# Make a call to your getMeetingSummaries Netlify function
response=$(curl -s -X POST -H "Content-Type: application/json" -d '{}' "${NETLIFY_BASE_URL}/.netlify/functions/getMeetingSummaries")
echo "Response from getMeetingSummaries: $response"

# Check if the response is valid JSON
if ! echo "$response" | jq -e . >/dev/null 2>&1; then
echo "Error: Invalid JSON response from getMeetingSummaries function"
exit 1
fi

summaries=$(echo "$response" | jq -c '.')
echo "summaries=$summaries" >> $GITHUB_OUTPUT

- name: Commit to GitHub
env:
NETLIFY_BASE_URL: ${{ secrets.NETLIFY_BASE_URL }}
run: |
curl -X POST ${{ secrets.NETLIFY_BASE_URL }}/.netlify/functions/commitToGitHub \
curl -X POST "${NETLIFY_BASE_URL}/.netlify/functions/commitToGitHub" \
-H 'Content-Type: application/json' \
-d '{
"owner": "SingularityNET-Archive",
"repo": "SingularityNET-Archive",
"filePath": "Data/meeting-summaries.json",
"content": ${{ toJson(steps.retrieve-summaries.outputs.summaries) }},
"content": ${{ steps.retrieve-summaries.outputs.summaries }},
"commitMessage": "Update meeting summaries"
}'