Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Resolve how not to hardcode workflow_dispatch for return-dispatch action in GH workflow templates #17

@rszamszur

Description

@rszamszur
  • I have searched the issues of this repo and believe that this is not a duplicate.

Feature Request

This is only needed for this project automation purposes. It should not be a part of the template. Maybe add this as a patch during CI?

# This trigger is required by fastapi-mvc automation to dispatch this concrete workflow
# from fastapi-mvc 'CI workflow' (https://github.com/fastapi-mvc/cookiecutter/actions/workflows/main.yml),
# and await its result. By no means should this be included in the template this file was generated from.
# It's just a temporary monkey patch to fulfill the GH automation use case.
# Feel free to remove it.
workflow_dispatch:
inputs:
distinct_id:
required: true
description: "Input required by codex-/return-dispatch@v1"
env:
POETRY_HOME: /opt/poetry
POETRY_CONFIG_DIR: /opt/poetry
POETRY_CACHE_DIR: /opt/poetry/cache
POETRY_VIRTUALENVS_PATH: /opt/poetry/store
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
# This echo is required by codex-/return-dispatch@v1 in order to identify dispatched workflow.
# By no means should this be included in the template this file was generated from.
# It's just a temporary monkey patch to fulfill the GH automation use case.
# Feel free to remove it.
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}

# This trigger is required by fastapi-mvc automation to dispatch this concrete workflow
# from fastapi-mvc 'CI workflow' (https://github.com/fastapi-mvc/cookiecutter/actions/workflows/main.yml),
# and await its result. By no means should this be included in the template this file was generated from.
# It's just a temporary monkey patch to fulfill the GH automation use case.
# Feel free to remove it.
workflow_dispatch:
inputs:
distinct_id:
required: true
description: "Input required by codex-/return-dispatch@v1"
env:
POETRY_HOME: /opt/poetry
POETRY_CONFIG_DIR: /opt/poetry
POETRY_CACHE_DIR: /opt/poetry/cache
POETRY_VIRTUALENVS_PATH: /opt/poetry/store
jobs:
# This job checks if an identical workflow is being triggered by different
# event and skips it. For instance there is no need to run the same pipeline
# twice for pull_request and push for identical commit sha.
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
# This echo is required by codex-/return-dispatch@v1 in order to identify dispatched workflow.
# By no means should this be included in the template this file was generated from.
# It's just a temporary monkey patch to fulfill the GH automation use case.
# Feel free to remove it.
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}

# This trigger is required by fastapi-mvc automation to dispatch this concrete workflow
# from fastapi-mvc 'CI workflow' (https://github.com/fastapi-mvc/cookiecutter/actions/workflows/main.yml),
# and await its result. By no means should this be included in the template this file was generated from.
# It's just a temporary monkey patch to fulfill the GH automation use case.
# Feel free to remove it.
workflow_dispatch:
inputs:
distinct_id:
required: true
description: "Input required by codex-/return-dispatch@v1"
jobs:
# This job checks if an identical workflow is being triggered by different
# event and skips it. For instance there is no need to run the same pipeline
# twice for pull_request and push for identical commit sha.
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
# This echo is required by codex-/return-dispatch@v1 in order to identify dispatched workflow.
# By no means should this be included in the template this file was generated from.
# It's just a temporary monkey patch to fulfill the GH automation use case.
# Feel free to remove it.
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}

Metadata

Metadata

Assignees

Labels

refactorRelated to major code refactoring/reorganisation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions