Skip to content

Commit

Permalink
feat: filter issues to migrate by milestone (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
icyphox authored Mar 3, 2022
1 parent cef43a3 commit 19d2fba
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/migrate-to-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
description: Name of the 'Todo' status on the project board
required: false
default: "Needs Triage"
milestone:
description: Name of the Milestone to filter by
required: false

env:
GITHUB_TOKEN: ${{ secrets.PLANNING_AUTOMATION_TOKEN }}
Expand Down Expand Up @@ -59,24 +62,40 @@ jobs:
edges {
node {
id
milestone {
id
title
}
}
}
}
prs: pullRequests(states: OPEN, first: 100) {
edges {
node {
id
milestone {
id
title
}
}
}
}
}
}' -f org="$org" -f repo="$repo" > data.json
- name: Extract issue/PR IDs and migrate
- env:
MILESTONE: ${{ inputs.milestone }}
name: Extract issue/PR IDs and migrate
run: |
if [[ "$MILESTONE" != "" ]]; then
ISSUE_IDS=($(jq -r '.data.repository.issues.edges[].node | select(.milestone.title == ${{ env.MILESTONE }}).id' -c data.json))
PR_IDS=($(jq -r '.data.repository.prs.edges[].node | select(.milestone.title == ${{ env.MILESTONE }}).id' -c data.json))
fi
ISSUE_IDS=($(jq .data.repository.issues.edges[].node.id -c data.json))
PR_IDS=($(jq .data.repository.prs.edges[].node.id -c data.json))
migrate() {
ISSUE_PR_ID="$1"
Expand Down

0 comments on commit 19d2fba

Please sign in to comment.