Skip to content

DRAFT: Feature/v5 [wip] #540

DRAFT: Feature/v5 [wip]

DRAFT: Feature/v5 [wip] #540

name: Project automations
on:
issues:
types:
- opened
- reopened
- closed
pull_request:
types:
- opened
- reopened
- review_requested
- closed
# map fields with customized labels
env:
status_todo: Todo
status_done: Done
status_in_progress: In Progress
project_id: 2
gh_organization: TEdit
gh_app_secret_key: ${{ secrets.GH_APP_SECRET_KEY }}
gh_app_installation_ID: 23302499
gh_app_ID: 172738
custom_field_values: '[{\"name\": \"Priority\",\"type\":\"single_select\",\"value\": \"Normal\"}]'
#custom_field_values: '[{\"name\": \"Priority\",\"type\": \"text\",\"value\": \"uuid1\"},{\"name\": \"Number\",\"type\": \"number\",\"value\": \"100\"},{\"name\": \"Date\",\"type\": \"date\",\"value\": \"2022-01-28T20:02:27.306+01:00\"},{\"name\": \"Single Select\",\"type\": \"single_select\",\"value\": \"Option 1\"},{\"name\": \"Iteration\",\"type\": \"iteration\",\"value\": \"Iteration 1\"}]'
jobs:
issue_opened_or_reopened:
name: issue_opened_or_reopened
runs-on: ubuntu-latest
if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened')
steps:
- name: 'Move issue to ${{ env.status_todo }}'
uses: leonsteinhaeuser/[email protected]
env:
DEBUG_LOG: "true"
with:
gh_app_secret_key: ${{ env.gh_app_secret_key }}
gh_app_ID: ${{ env.gh_app_ID }}
gh_app_installation_ID: ${{ env.gh_app_installation_ID }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
status_value: ${{ env.status_todo }}
issue_closed:
name: issue_closed
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'closed'
steps:
- name: Moved issue to ${{ env.status_done }}
uses: leonsteinhaeuser/[email protected]
env:
DEBUG_LOG: "true"
with:
gh_app_secret_key: ${{ env.gh_app_secret_key }}
gh_app_ID: ${{ env.gh_app_ID }}
gh_app_installation_ID: ${{ env.gh_app_installation_ID }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
status_value: ${{ env.status_todo }}
pr_opened_or_reopened:
name: pr_opened_or_reopened
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')
steps:
- name: 'Move PR to ${{ env.status_in_progress }}'
uses: leonsteinhaeuser/[email protected]
env:
DEBUG_LOG: "true"
with:
gh_app_secret_key: ${{ env.gh_app_secret_key }}
gh_app_ID: ${{ env.gh_app_ID }}
gh_app_installation_ID: ${{ env.gh_app_installation_ID }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.project_id }}
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: ${{ env.status_todo }}
pr_closed:
name: pr_closed
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed'
steps:
- name: Move PR to ${{ env.status_done }}
uses: leonsteinhaeuser/[email protected]
env:
DEBUG_LOG: "true"
with:
gh_app_secret_key: ${{ env.gh_app_secret_key }}
gh_app_ID: ${{ env.gh_app_ID }}
gh_app_installation_ID: ${{ env.gh_app_installation_ID }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.project_id }}
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: ${{ env.status_todo }}