Skip to content

issue_opened

issue_opened #16

Workflow file for this run

name: "auto_project"
on:
repository_dispatch:
types:
- issue_opened
- issue_reopened
- issue_labeled
concurrency:
group: ${{ github.event.client_payload.repo }}/${{ github.workflow }}
jobs:
setup:
outputs:
automation-config: ${{ steps.automation-config.outputs.config }}
runs-on: ubuntu-latest
steps:
- uses: roc-streaming/ci/actions/automation-config@main
id: automation-config
with:
repo: ${{ github.event.client_payload.repo }}
github-token: ${{ secrets.BOT_TOKEN }}
# issue opened
on-open:
needs: setup
if: |
fromJSON(needs.setup.outputs.automation-config).auto_project != null &&
(github.event.action == 'issue_opened' ||
github.event.action == 'issue_reopened')
runs-on: ubuntu-latest
steps:
# assign project
- uses: roc-streaming/ci/actions/update-project@main
with:
repo: ${{ github.event.client_payload.repo }}
number: ${{ github.event.client_payload.number }}
project: ${{ fromJSON(needs.setup.outputs.automation-config).auto_project.project_id }}
github-token: ${{ secrets.BOT_TOKEN }}
# issue labeled
on-label:
needs: setup
if: |
fromJSON(needs.setup.outputs.automation-config).auto_project != null &&
fromJSON(needs.setup.outputs.automation-config).auto_project.label_to_column != null &&
github.event.action == 'issue_labeled'
runs-on: ubuntu-latest
steps:
# assign project column (status) based on labels
- uses: roc-streaming/ci/actions/update-project@main
with:
repo: ${{ github.event.client_payload.repo }}
number: ${{ github.event.client_payload.number }}
project: ${{ fromJSON(steps.automation-config.outputs.info).auto_project.project_id }}
label-to-status: |
${{ toJSON(fromJSON(needs.setup.outputs.automation-config).auto_project.label_to_column) }}
github-token: ${{ secrets.BOT_TOKEN }}