performed triage on boards and created agentic workflow tools for org… #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Reopen issue when Open Roles item moved out of Filled | ||
| on: | ||
| projects_v2_item: | ||
| types: | ||
| - edited | ||
| env: | ||
| GH_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | ||
| OPEN_ROLES_PROJECT_ID: PVT_kwDOAA7NZM4AmdbW | ||
| OPEN_OPTION_ID: f75ad846 | ||
| IN_PROGRESS_OPTION_ID: "561a5d37" | ||
| jobs: | ||
| open-roles-reopen: | ||
| if: github.event.projects_v2_item.project_node_id == 'PVT_kwDOAA7NZM4AmdbW' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Reopen issue if moved to Open or In Progress while closed | ||
| run: | | ||
| ITEM_ID="${{ github.event.projects_v2_item.node_id }}" | ||
| # Get current status and linked issue state | ||
| RESULT=$(gh api graphql -f query=' | ||
| query($item: ID!) { | ||
| node(id: $item) { | ||
| ... on ProjectV2Item { | ||
| fieldValueByName(name: "Status") { | ||
| ... on ProjectV2ItemFieldSingleSelectValue { optionId } | ||
| } | ||
| content { | ||
| ... on Issue { | ||
| number | ||
| state | ||
| repository { nameWithOwner } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }' -f item="$ITEM_ID") | ||
| OPTION_ID=$(echo "$RESULT" | jq -r '.data.node.fieldValueByName.optionId // ""') | ||
| ISSUE_NUMBER=$(echo "$RESULT" | jq -r '.data.node.content.number // ""') | ||
| ISSUE_STATE=$(echo "$RESULT" | jq -r '.data.node.content.state // ""') | ||
| REPO=$(echo "$RESULT" | jq -r '.data.node.content.repository.nameWithOwner // ""') | ||
| # Only act on Open or In Progress | ||
| if [ "$OPTION_ID" != "$OPEN_OPTION_ID" ] && [ "$OPTION_ID" != "$IN_PROGRESS_OPTION_ID" ]; then | ||
| echo "Status is not 'Open' or 'In Progress' — skipping." | ||
| exit 0 | ||
| fi | ||
| if [ -z "$ISSUE_NUMBER" ] || [ -z "$REPO" ]; then | ||
| echo "No linked issue — nothing to reopen." | ||
| exit 0 | ||
| fi | ||
| # Guard: only reopen if the issue is actually closed | ||
| if [ "$ISSUE_STATE" != "CLOSED" ]; then | ||
| echo "Issue #$ISSUE_NUMBER is already open — skipping." | ||
| exit 0 | ||
| fi | ||
| echo "Role moved to Open/In Progress — reopening issue #$ISSUE_NUMBER in $REPO..." | ||
| gh issue reopen "$ISSUE_NUMBER" --repo "$REPO" | ||
| echo "Done." | ||