Auto-create GitHub issue on Hugo deploy failure (#49)

* Add GitHub Discussions weekly announcement integration - Enable Discussions feature on the repository - Add 'Post to Discussions' step to notify job - Post weekly summary as Discussion in Announcements category - Make step optional with continue-on-error to prevent workflow failure Closes #21 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add deploy failure issue notification Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address Copilot review comments on PR #49 - Remove 'Post to Discussions' changes from crawl-and-publish.yml (out of scope for PR) - Fix deploy-site.yml to use run ID instead of date in issue title (prevents stale titles) - These changes align with the PR's stated purpose of auto-creating issues on deploy failures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Juan Manuel Servera committed May 18, 2026 at 16:50 UTC 39ba0adf1caaf90b1a3368fc5fdc7eaa237fc2d4
2 files changed +32 -1
.github/workflows/crawl-and-publish.yml
+2 -1
@@ -467,7 +467,8 @@ jobs:
467 run: |
468 WEEK=$(basename "$SUMMARY_FILE" | sed 's/-summary.md//')
469
470 - gh release create "week-${WEEK}" --title "Week ${WEEK} — Tech Trends Summary" --notes-file "$SUMMARY_FILE" --latest
470 + gh release create "week-${WEEK}" --title "Week ${WEEK} — Tech Trends Summary" --notes-file "$SUMMARY_FILE" --latest
471 +
472
473 reskill-check:
474 needs: [crawl]
.github/workflows/deploy-site.yml
+30
@@ -74,3 +74,33 @@ jobs:
74 - name: Deploy to GitHub Pages
75 id: deployment
76 uses: actions/deploy-pages@v4
77 +
78 + notify-failure:
79 + needs: [build, deploy]
80 + if: failure()
81 + runs-on: ubuntu-latest
82 + permissions:
83 + issues: write
84 + steps:
85 + - name: Create or update failure issue
86 + env:
87 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88 + GH_REPO: ${{ github.repository }}
89 + run: |
90 + EXISTING=$(gh issue list --label 'deploy-failure' --state open --json number --jq length)
91 + if [ "$EXISTING" -gt 0 ]; then
92 + ISSUE_NUM=$(gh issue list --label 'deploy-failure' --state open --json number --jq '.[0].number')
93 + gh issue comment "$ISSUE_NUM" --body "Deploy failed again: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
94 + echo "Updated existing issue #$ISSUE_NUM"
95 + else
96 + BODY=$(printf '%s\n\n%s\n\n%s\n%s\n%s' \
97 + "The Deploy Hugo site workflow failed." \
98 + "**Run:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
99 + "Please triage:" \
100 + "- If transient (rate limit, network), close with comment" \
101 + "- If real bug, assign to the right squad member")
102 + gh issue create \
103 + --title "🔴 Deploy Hugo site failed (run ${{ github.run_id }})" \
104 + --label 'squad,deploy-failure' \
105 + --body "$BODY"
106 + fi