Skip to content

Commit d8bfe43

Browse files
author
jhengy
committed
Update github actions to post per article summary in issue comment to address character limit exceeded problem
- GraphQL: Body is too long (maximum is 65536 characters) (createIssue)
1 parent bd6de7b commit d8bfe43

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

.github/workflows/run.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,20 @@ jobs:
6060
env:
6161
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
run: |
63-
FILE_NAME="issue.md"
64-
./scripts/create_issue_body.sh $FILE_NAME
65-
cat $FILE_NAME
63+
SUMMARY_FILE_NAME="summary.md"
64+
./scripts/md_executive_summary.sh $SUMMARY_FILE_NAME
65+
cat $SUMMARY_FILE_NAME
6666
67-
# Create issue using GitHub CLI
68-
gh issue create \
67+
ISSUE_URL=$(gh issue create \
6968
--title "Daily Content Summary $(date +'%Y-%m-%d')" \
70-
--body-file $FILE_NAME \
71-
--label automated
69+
--body-file $SUMMARY_FILE_NAME \
70+
--label automated)
71+
ISSUE_NUMBER=$(echo $ISSUE_URL | grep -oP '(?<=issues/)\d+$')
72+
echo "Created issue number: $ISSUE_NUMBER from $ISSUE_URL"
73+
74+
# Add articles processed as comment
75+
ARTICLES_FILE_NAME="summary.md"
76+
./scripts/md_processed_articles.sh $ARTICLES_FILE_NAME
77+
cat $ARTICLES_FILE_NAME
78+
gh issue comment "$ISSUE_NUMBER" --body-file "$ARTICLES_FILE_NAME"
7279

scripts/md_executive_summary.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Accept filename as argument or default to issue_body.md
4+
FILE_NAME=${1:-executive_summary.md}
5+
6+
echo -e "# 📰 Daily Content Summary - $(date +'%Y-%m-%d')" > $FILE_NAME
7+
echo -e "### Executive Summary" >> $FILE_NAME
8+
echo -e "\n$(cat outputs/*_summary.txt 2>/dev/null || echo 'No summary generated')\n" >> $FILE_NAME

scripts/md_processed_articles.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Accept filename as argument or default to issue_body.md
4+
FILE_NAME=${1:-processed_articles.md}
5+
6+
echo -e "---\n### Articles Processed" >> $FILE_NAME
7+
echo -e "| 📑 Article | 👤 Author | 📄 Summary | 🏷️ Tags |" >> $FILE_NAME
8+
echo -e "|---------|-----------|-----------|--------|" >> $FILE_NAME
9+
jq -r '.[] | "| [🔗](\(.url)) \(.title) | \(.author) | \(.summary) | \(.tags) |"' outputs/*.json >> $FILE_NAME 2>/dev/null || echo "No articles processed today" >> $FILE_NAME
10+
echo -e "---\n*🤖 Automated Report [$(date +'%Y-%m-%d %H:%M:%S %Z')]*" >> $FILE_NAME

0 commit comments

Comments
 (0)