Skip to content

Commit acc1694

Browse files
authored
Merge branch 'main' into fix/hbar
Signed-off-by: prajeeta <[email protected]>
2 parents cba7a32 + 630267a commit acc1694

21 files changed

+392
-30
lines changed

.github/ISSUE_TEMPLATE/06_advanced_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ body:
6565
>
6666
> 📖 Helpful references:
6767
> - `docs/sdk_developers/training`
68-
> - `docs/sdk_developers/project_structure.md`
68+
> - `docs/sdk_developers/training/setup/project_structure.md`
6969
> - `docs/sdk_developers/rebasing.md`
7070
7171
- type: textarea
File renamed without changes.

.github/scripts/issue_reminder_no_pr.sh renamed to .github/scripts/bot-issue-reminder-no-pr.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ echo "$ALL_ISSUES_JSON" | jq -c '.' | while read -r ISSUE_JSON; do
134134

135135
echo "[REMIND] Issue #$ISSUE assigned for $DIFF_DAYS days, posting reminder."
136136

137-
# Post reminder comment
138-
MESSAGE="Hi, this is ReminderBot. This issue has been assigned but has had no pull request created. Are you still planning on working on the issue?
137+
ASSIGNEE_MENTIONS=$(echo "$ISSUE_JSON" | jq -r '.assignees[].login | "@" + .' | xargs)
138+
139+
MESSAGE="Hi ${ASSIGNEE_MENTIONS} 👋
140+
141+
This issue has been assigned but no pull request has been created yet.
142+
Are you still planning on working on it?
139143
140144
From the Python SDK Team"
141145

.github/workflows/bot-assignment-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
REPO: ${{ github.repository }}
2828
run: |
2929
# Make script executable (just in case permissions were lost during checkout)
30-
chmod +x .github/scripts/check_assignment_limit.sh
31-
30+
chmod +x .github/scripts/bot-assignment-check.sh
31+
3232
# Run the script
33-
./.github/scripts/check_assignment_limit.sh
33+
./.github/scripts/bot-assignment-check.sh

.github/workflows/bot-inactivity-unassign-phase.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ jobs:
3838
# - schedule: DRY_RUN = 0 (real actions)
3939
# - workflow_dispatch: DRY_RUN derived from the "dry_run" input
4040
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.dry_run == 'true' && '1' || '0') || '0' }}
41-
run: bash .github/scripts/inactivity_bot.sh
41+
run: bash .github/scripts/bot-inactivity-unassign-phase.sh

.github/workflows/bot-issue-reminder-no-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
REPO: ${{ github.repository }}
3636
DAYS: 7
3737
DRY_RUN: ${{ inputs.dry_run || 'false' }}
38-
run: bash .github/scripts/issue_reminder_no_pr.sh
38+
run: bash .github/scripts/bot-issue-reminder-no-pr.sh
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Cron – Check Broken Markdown Links
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 1 * *'
6+
workflow_dispatch:
7+
inputs:
8+
dry_run:
9+
description: 'Run without creating issues? (true/false)'
10+
required: true
11+
default: true
12+
type: boolean
13+
14+
permissions:
15+
contents: read
16+
issues: write
17+
18+
jobs:
19+
cron-check-broken-links:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Harden runner (audit outbound calls)
23+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
24+
with:
25+
egress-policy: audit
26+
27+
- name: Checkout repository
28+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
29+
30+
- name: Check Markdown links (Lychee)
31+
id: lychee
32+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
33+
continue-on-error: true
34+
with:
35+
args: --verbose --no-progress './**/*.md'
36+
fail: true
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Report Broken Links (Idempotent Issue Management)
41+
if: steps.lychee.outcome == 'failure'
42+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
43+
with:
44+
script: |
45+
// Determine if this is a dry run
46+
const isManual = context.eventName === 'workflow_dispatch';
47+
const dryRun = isManual ? String(context.payload.inputs.dry_run).toLowerCase() === 'true' : false;
48+
49+
// Labels configuration
50+
const targetLabels = ['broken-markdown-links', 'automated'];
51+
const issueTitle = "Scheduled Markdown Link Check Found Broken Links";
52+
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
53+
54+
console.log(`Event: ${context.eventName}, Dry Run: ${dryRun}`);
55+
56+
// Define Issue Body
57+
const body = `### 🔗 Broken Links Detected\n\n` +
58+
`The scheduled markdown link check workflow has detected broken links.\n\n` +
59+
`**Run Details:**\n` +
60+
`- **Timestamp:** ${new Date().toISOString()}\n` +
61+
`- **Workflow Run:** [View Logs](${runUrl})\n\n` +
62+
`> **Note:** We use [Lychee](https://github.com/lycheeverse/lychee) for link checking. ` +
63+
`Please check the "Check Markdown links" step in the logs to see the specific URLs that failed.`;
64+
65+
if (dryRun) {
66+
console.log("DRY RUN: Would have created or updated an issue.");
67+
return;
68+
}
69+
70+
// Search for existing issue and Update/Create
71+
try {
72+
const { data: issues } = await github.rest.issues.listForRepo({
73+
owner: context.repo.owner,
74+
repo: context.repo.repo,
75+
state: 'open',
76+
labels: targetLabels.join(','),
77+
per_page: 100
78+
});
79+
80+
const existingIssue = issues.find(issue => issue.title === issueTitle);
81+
82+
if (existingIssue) {
83+
console.log(`Updating existing issue #${existingIssue.number}`);
84+
await github.rest.issues.createComment({
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
issue_number: existingIssue.number,
88+
body: `**Update ${new Date().toISOString()}:** Still finding broken links.\nCheck new run logs: ${runUrl}`
89+
});
90+
} else {
91+
console.log("Creating a new issue...");
92+
await github.rest.issues.create({
93+
owner: context.repo.owner,
94+
repo: context.repo.repo,
95+
title: issueTitle,
96+
body: body,
97+
labels: targetLabels
98+
});
99+
}
100+
} catch (error) {
101+
console.error('Failed to manage broken link issue:', error);
102+
core.setFailed(`Failed to create or update issue: ${error.message}`);
103+
}

0 commit comments

Comments
 (0)