Skip to content

Test 6

Test 6 #76

Workflow file for this run

name: Project - Todo
on:
issues:
types: [opened]
jobs:
automate-project-columns:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GHPROJECT_TOKEN }}
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to retrieve tags
- id: add_issue_to_project
run: gh issue edit ${{ github.event.issue.number }} --add-project "topup-gateway-test"
- id: obtain_project_id
run: echo "PROJECT_ID=$(gh project list --owner "AidaAP" --format=json | jq '.projects[] | select(.number==2) | .id')" >> $GITHUB_ENV
- id: obtain_issue_id
run: gh project item-list 2 --owner "AidaAP" --format=json | jq '.items[] | select(.content.type=="Issue" and .content.number==${{ github.event.issue.number }})'
# run: echo "ISSUE_ID=$(gh project item-list 2 --owner "AidaAP" --format=json | jq '.items[] | select(.content.type=="Issue" and .content.number=="${{ github.event.issue.number }}") | .id')" >> $GITHUB_ENV
- id: obtain_field_id
run: echo "FIELD_ID=$(gh project field-list 2 --owner "AidaAP" --format=json | jq '.fields[] | select(.name=="Status") | .id')" >> $GITHUB_ENV
- id: obtain_field_value_id
run: echo "FIELD_VALUE_ID=$(gh project field-list 2 --owner "AidaAP" --format=json | jq '.fields[] | select(.name=="Status") | .options[] | select(.name=="Todo") | .id')" >> $GITHUB_ENV
- id: list_projects
run: gh project list --owner "AidaAP"
- id: list_project_fields
run: gh project field-list 2 --owner "AidaAP"
- id: list_project_issues
run: gh issue list --repo "AidaAP/topup-gateway-test"
- id: set_issue_status_todo
run: gh project item-edit --project-id "${PROJECT_ID}" --id "${ISSUE_ID}" --field-id "${FIELD_ID}" --single-select-option-id "${FIELD_VALUE_ID}"
# - id: add_to_project
# run: gh project item-add 2 --owner "AidaAP" --url "${{ github.event.issue.url }}"
# - id: checkout
# name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0 # Required to retrieve tags
# - uses: ./.github/actions/project-automation
# with:
# project: topup-gateway-test
# column: Todo
# repo-token: ${{ secrets.GHPROJECT_TOKEN }}