Florian Wuennemann
03/12/2025, 8:56 PMFlorian Wuennemann
03/12/2025, 9:07 PMSimon Pearce
03/12/2025, 9:07 PMFlorian Wuennemann
03/12/2025, 9:07 PMFlorian Wuennemann
03/12/2025, 9:07 PMFlorian Wuennemann
03/12/2025, 9:32 PM#!/bin/bash
# Script to add open issues from a GitHub repository to a GitHub project
# Usage: ./project_tag_to_issues.sh [repository] [project_number] [owner]
set -e # Exit immediately if a command exits with a non-zero status
# Default values
REPO=${1:-"nf-core/modules"} # Note: GitHub usernames are case-sensitive
PROJECT_NUMBER=${2:-"102"}
OWNER=${3:-"nf-core"} # GitHub username of the project owner
echo "Adding open issues from $REPO to project number $PROJECT_NUMBER (owned by $OWNER)..."
# Get all open issues and add them to the project
for issue_number in $(gh issue list --repo "$REPO" --state open --limit 1000 --json number,title --jq '.[] | select(.title | contains("nf-test migration") | not) | .number'); do
echo "Adding issue #$issue_number to project..."
# Construct the issue URL and use --url flag
ISSUE_URL="https://github.com/$REPO/issues/$issue_number"
gh project item-add "$PROJECT_NUMBER" --owner "$OWNER" --url "$ISSUE_URL"
done
echo "Done! All open issues have been added to the project."Florian Wuennemann
03/12/2025, 9:36 PM