Skip to content

Control Instance from Workflow #26

Control Instance from Workflow

Control Instance from Workflow #26

name: Control Instance from Workflow
on:
workflow_dispatch:
inputs:
issue_number:
description: "Issue number"
required: true
type: number
command_name:
description:
"Name of the command to execute: create, delete, shelve, unshelve"
required: true
type: string
workflow_call:
inputs:
issue_number:
description: "Issue number"
required: true
type: number
command_name:
description:
"Name of the command to execute: create, delete, shelve, unshelve"
required: true
type: string
permissions:
issues: write
checks: read
jobs:
control:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Control instance
run: |
gh issue comment $ISSUE_NUMBER \
-b "Command <tt>shelve</tt> issued by **control-instance-from-workflow.yml** workflow<br> \
<br> \
For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ inputs.issue_number }}
- name: Control instance
uses: ./.github/actions/control-instance
with:
os_cloud: ${{ vars.MORPHOCLOUD_OS_CLOUD }}
issue_number: ${{ inputs.issue_number }}
command_name: ${{ inputs.command_name }}
instance_name_prefix: ${{ vars.INSTANCE_NAME_PREFIX }}
token: ${{ secrets.GITHUB_TOKEN }}
string_encryption_key: ${{ secrets.STRING_ENCRYPTION_KEY }}
mail_server_username: ${{secrets.MAIL_USERNAME}}
mail_server_password: ${{secrets.MAIL_PASSWORD}}