diff --git a/.github/workflows/workflow_issues_to_project.yml b/.github/workflows/workflow_issues_to_project.yml deleted file mode 100644 index 7ab8cc0f9a6..00000000000 --- a/.github/workflows/workflow_issues_to_project.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: issues to project workflow -on: - workflow_call: - inputs: - node_id: - required: true - type: string - status: - required: false - type: string - default: New - secrets: - token: - required: true -jobs: - add_issue_pr: - runs-on: ubuntu-latest - steps: - - name: Get project data - env: - GITHUB_TOKEN: ${{secrets.token}} - ORGANIZATION: commercetools - PROJECT_NUMBER: 32 - STATUS: ${{ inputs.status }} - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - query($org: String!, $number: Int!) { - organization(login: $org){ - projectNext(number: $number) { - id - fields(first:20) { - nodes { - id - name - settings - } - } - } - } - }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json - echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV - echo 'DATE_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_OPTION_ID='$(jq --arg STATUS "$STATUS" '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name==$STATUS) |.id' project_data.json) >> $GITHUB_ENV - - name: Add Issue/PR to project - env: - GITHUB_TOKEN: ${{secrets.token}} - NODE_ID: ${{ inputs.node_id }} - run: | - item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation($project:ID!, $node:ID!) { - addProjectNextItem(input: {projectId: $project, contentId: $node}) { - projectNextItem { - id - } - } - }' -f project=$PROJECT_ID -f node=$NODE_ID --jq '.data.addProjectNextItem.projectNextItem.id')" - - echo 'ITEM_ID='$item_id >> $GITHUB_ENV - - name: Get date - run: echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV - - - name: Set fields - env: - GITHUB_TOKEN: ${{secrets.token}} - run: | - gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' - mutation ( - $project: ID! - $item: ID! - $status_field: ID! - $status_value: String! - $date_field: ID! - $date_value: String! - ) { - set_status: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $status_field - value: $status_value - }) { - projectNextItem { - id - } - } - set_date_posted: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $date_field - value: $date_value - }) { - projectNextItem { - id - } - } - }' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.STATUS_OPTION_ID }} -f date_field=$DATE_FIELD_ID -f date_value=$DATE --silent