diff --git a/.github/actions/control-instance/action.yml b/.github/actions/control-instance/action.yml index fb090390..28a2be79 100644 --- a/.github/actions/control-instance/action.yml +++ b/.github/actions/control-instance/action.yml @@ -11,7 +11,7 @@ inputs: required: true command_name: description: - "Name of the command to execute: create, delete, shelve, unshelve" + "Name of the command to execute: create, delete_instance, shelve, unshelve" required: true instance_name_prefix: description: "Instance name prefix" @@ -34,8 +34,8 @@ runs: - name: Validate command shell: bash run: | - if [[ ! $COMMAND_NAME =~ ^create|delete|shelve|unshelve$ ]]; then - echo "::error ::Unknown command name 'COMMAND_NAME'. Valid commands are 'create', 'delete', 'shelve' or 'unshelve'." + if [[ ! $COMMAND_NAME =~ ^create|delete_instance|shelve|unshelve$ ]]; then + echo "::error ::Unknown command name 'COMMAND_NAME'. Valid commands are 'create', 'delete_instance', 'shelve' or 'unshelve'." exit 1 fi env: @@ -51,7 +51,7 @@ runs: expected_status="ACTIVE" elif [[ $COMMAND_NAME == "create" ]]; then expected_status="ACTIVE" - elif [[ $COMMAND_NAME == "delete" ]]; then + elif [[ $COMMAND_NAME == "delete_instance" ]]; then expected_status="" fi echo "expected_status [$expected_status]" @@ -245,4 +245,4 @@ runs: issue_number: ${{ inputs.issue_number }} instance_name: ${{ steps.define.outputs.instance_name }} instance_status: - ${{ inputs.command_name == 'delete' && 'DELETED' || '' }} + ${{ inputs.command_name == 'delete_instance' && 'DELETED' || '' }} diff --git a/.github/workflows/control-instance-from-workflow.yml b/.github/workflows/control-instance-from-workflow.yml index 7ceadd96..2a850989 100644 --- a/.github/workflows/control-instance-from-workflow.yml +++ b/.github/workflows/control-instance-from-workflow.yml @@ -9,7 +9,8 @@ on: type: number command_name: description: - "Name of the command to execute: create, delete, shelve, unshelve" + "Name of the command to execute: create, delete_instance, shelve, + unshelve" required: true type: string workflow_call: @@ -20,7 +21,8 @@ on: type: number command_name: description: - "Name of the command to execute: create, delete, shelve, unshelve" + "Name of the command to execute: create, delete_instance, shelve, + unshelve" required: true type: string permissions: diff --git a/.github/workflows/control-instance.yml b/.github/workflows/control-instance.yml index 732517ad..1c3ce176 100644 --- a/.github/workflows/control-instance.yml +++ b/.github/workflows/control-instance.yml @@ -16,7 +16,7 @@ jobs: ${{ !github.event.issue.pull_request && ( contains(github.event.comment.body, '/unshelve') || contains(github.event.comment.body, '/shelve') || - contains(github.event.comment.body, '/delete') ) }} + contains(github.event.comment.body, '/delete_instance') ) }} steps: - name: unshelve command id: unshelve_command @@ -42,11 +42,11 @@ jobs: "${{ vars.MORPHOCLOUD_GITHUB_ADMINS }},${{ github.event.issue.user.login }}" - - name: delete command - id: delete_command + - name: delete_instance command + id: delete_instance_command uses: github/command@v1.2.0 with: - command: "/delete" + command: "/delete_instance" reaction: "rocket" allowed_contexts: "issue" permissions: "write,maintain,admin" @@ -57,7 +57,7 @@ jobs: if: ${{ steps.unshelve_command.outputs.continue == 'true' || steps.shelve_command.outputs.continue == 'true' || - steps.delete_command.outputs.continue == 'true' }} + steps.delete_instance_command.outputs.continue == 'true' }} run: | if [[ "$UNSHELVE_COMMAND_CONTINUE" == "true" ]]; then continue="$UNSHELVE_COMMAND_CONTINUE" @@ -67,10 +67,10 @@ jobs: continue="$SHELVE_COMMAND_CONTINUE" command_name="shelve" comment_id="${{ steps.shelve_command.outputs.comment_id }}" - elif [[ "$DELETE_COMMAND_CONTINUE" == "true" ]]; then - continue="$DELETE_COMMAND_CONTINUE" - command_name="delete" - comment_id="${{ steps.delete_command.outputs.comment_id }}" + elif [[ "$DELETE_INSTANCE_COMMAND_CONTINUE" == "true" ]]; then + continue="$DELETE_INSTANCE_COMMAND_CONTINUE" + command_name="delete_instance" + comment_id="${{ steps.delete_instance_command.outputs.comment_id }}" else continue="false" command_name="" @@ -83,7 +83,8 @@ jobs: UNSHELVE_COMMAND_CONTINUE: ${{ steps.unshelve_command.outputs.continue }} SHELVE_COMMAND_CONTINUE: ${{ steps.shelve_command.outputs.continue }} - DELETE_COMMAND_CONTINUE: ${{ steps.delete_command.outputs.continue }} + DELETE_INSTANCE_COMMAND_CONTINUE: + ${{ steps.delete_instance_command.outputs.continue }} - uses: actions/checkout@v4 diff --git a/issue-commands.md b/issue-commands.md index 66292d11..81a65784 100644 --- a/issue-commands.md +++ b/issue-commands.md @@ -3,12 +3,12 @@ _The commands described below may be added as issue comments. Only one command may be entered per comment._ -| Command | Description | Who | -| --------------- | -------------------------------------------------- | -------------------- | -| `/shelve` | Shelve the instance. | Issue creator, Admin | -| `/unshelve` | Unshelve the instance. | Issue creator, Admin | -| `/encode_email` | Update issue description obfuscating email. | Issue creator, Admin | -| `/decode_email` | Update issue description deobfuscating email. | Issue creator, Admin | -| `/email` | Send email to _Issue creator_ with connection URL. | Issue creator, Admin | -| `/create` | Create the instance. | Admin | -| `/delete` | Delete the instance. | Admin | +| Command | Description | Who | +| ------------------ | -------------------------------------------------- | -------------------- | +| `/shelve` | Shelve the instance. | Issue creator, Admin | +| `/unshelve` | Unshelve the instance. | Issue creator, Admin | +| `/encode_email` | Update issue description obfuscating email. | Issue creator, Admin | +| `/decode_email` | Update issue description deobfuscating email. | Issue creator, Admin | +| `/email` | Send email to _Issue creator_ with connection URL. | Issue creator, Admin | +| `/create` | Create the instance. | Admin | +| `/delete_instance` | Delete the instance. | Admin |