3.2.0-beta.69 #222
Workflow file for this run
This file contains 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: Move Issues | |
on: | |
push: | |
paths: | |
- 'package.json' | |
env: | |
GH_TOKEN: ${{ secrets.TOKEN }} | |
jobs: | |
prerequisites: | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.version.outputs.VERSION }} | |
steps: | |
- uses: actions/checkout@v3 | |
# get version | |
- name: Get Version | |
id: version | |
run: | | |
V=$(jq .version package.json | sed 's/"//g') | |
echo "VERSION=v$V" >> $GITHUB_OUTPUT # for subsequent jobs | |
echo v$V | |
move-issues: | |
needs: prerequisites | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: process-issues | |
run: | | |
minorVersion=$(echo ${{ needs.prerequisites.outputs.VERSION }} | cut -d. -f1,2).x | |
# add gh extension | |
gh extension install heaths/gh-merge-json | |
# get issues from project | |
# gh api graphql --paginate -F user=Zefau -F project=2 -f query=' | |
# query GetIssuesFromProject($user:String!,$project:Int!,$endCursor:String) { | |
# user(login: $user) { | |
# projectV2(number: $project) { # ProjectV2: https://docs.github.com/en/graphql/reference/objects#projectv2 | |
# id, | |
# fields(first: 100) { # ProjectV2FieldConfigurationConnection | |
# totalCount | |
# nodes { # ProjectV2FieldConfiguration | |
# ... on ProjectV2SingleSelectField { | |
# id | |
# name | |
# dataType | |
# options { id name } | |
# } | |
# } | |
# } | |
# items(first: 100, after: $endCursor) { | |
# totalCount | |
# pageInfo { endCursor hasNextPage } | |
# nodes { | |
# id, | |
# content { | |
# ... on Issue { | |
# issueId: id | |
# number | |
# title | |
# labels(first: 100) { | |
# totalCount | |
# nodes { id name } | |
# } | |
# state | |
# } | |
# } | |
# status: fieldValueByName(name: "Status") { | |
# ... on ProjectV2ItemFieldSingleSelectValue { id name updatedAt } | |
# } | |
# version: fieldValueByName(name: "Version") { | |
# ... on ProjectV2ItemFieldSingleSelectValue { id name updatedAt } | |
# } | |
# } | |
# } | |
# } | |
# } | |
# }' | gh merge-json > issues.json | |
# extract issues (open issue in the project-status "IMPLEMENTED LOCALLY" matching the given version | |
# ISSUES=$(cat issues.json | jq .data.user.projectV2.items.nodes | jq --arg version "$minorVersion" -c '.[] | select(.content.state == "OPEN") | select(.status.name == "IMPLEMENTED LOCALLY") | select(.version.name == $version) | [ .id, .content.issueId, [.content.labels.nodes[].name] ]') | |
# extract values of field `released` | |
# FIELDS=$(cat issues.json | jq .data.user.projectV2.fields.nodes | jq -c '.[] | select(.name == "Released") | .options') | |
# FIELDS=$(echo $FIELDS | cut -d' ' -f1) | |
# get issues | |
gh issue list -L 9999 --json id,labels,number,state,title > issues.json | |
# extract issues [ by label "#status: implemented-locally" (LA_kwDODbcoCM8AAAABfBUbZQ) matching the given version by a dedicated label ] | |
ISSUES=$(cat issues.json | jq -c '.[] | select(.labels[].name == "#status: implemented-locally :hammer_and_wrench:") | select(.labels[].name == "v3.2") | [ .id, .number, [ .labels[].name ]]') | |
# | |
cd $GITHUB_WORKSPACE | |
cd .github && cd workflows | |
# node move-issues.js "${{ needs.prerequisites.outputs.VERSION }}" "$ISSUES" "$FIELDS" | |
node move-issues.js "${{ needs.prerequisites.outputs.VERSION }}" "$ISSUES" |