Download ProjectIntakeTower/github/gh_create_issues.sh from smlflg/AgentProjectMinenraeumer: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/smlflg/AgentProjectMinenraeumer/resolve/main/ProjectIntakeTower/github/gh_create_issues.sh
- Command line
-
hf download hf://smlflg/AgentProjectMinenraeumer/ProjectIntakeTower/github/gh_create_issues.sh
-
curl -L -o gh_create_issues.sh https://huggingface.co/smlflg/AgentProjectMinenraeumer/resolve/main/ProjectIntakeTower/github/gh_create_issues.sh
1.16 kB
| set -euo pipefail | |
| # Human-gated script. Do not run blindly. | |
| # Usage after reviewing drafts: | |
| # DRY_RUN=1 ./github/gh_create_issues.sh | |
| # DRY_RUN=0 ./github/gh_create_issues.sh | |
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| DRAFT_DIR="$ROOT/github/issue_drafts" | |
| DRY_RUN="${DRY_RUN:-1}" | |
| if ! command -v gh >/dev/null 2>&1; then | |
| echo "gh CLI not found" >&2 | |
| exit 2 | |
| fi | |
| gh auth status >/dev/null | |
| find "$DRAFT_DIR" -type f -name '*.md' | sort | while read -r draft; do | |
| title="$(grep -m1 '^Title:' "$draft" | sed 's/^Title:[[:space:]]*//')" | |
| repo="$(grep -m1 '^Repo:' "$draft" | sed 's/^Repo:[[:space:]]*//')" | |
| labels="$(grep -m1 '^Labels:' "$draft" | sed 's/^Labels:[[:space:]]*//')" | |
| if [[ -z "$title" || -z "$repo" ]]; then | |
| echo "SKIP missing Title/Repo: $draft" >&2 | |
| continue | |
| fi | |
| echo "ISSUE draft=$draft repo=$repo title=$title labels=$labels" | |
| if [[ "$DRY_RUN" == "0" ]]; then | |
| if [[ -n "$labels" ]]; then | |
| gh issue create --repo "$repo" --title "$title" --body-file "$draft" --label "$labels" | |
| else | |
| gh issue create --repo "$repo" --title "$title" --body-file "$draft" | |
| fi | |
| fi | |
| done | |