Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
List of MorphoCloudWorkflow changes:

```
$ git shortlog d4e1ccb..e2141dd --no-merges
Jean-Christophe Fillion-Robin (1):
      feat: Rename command from "/delete" to "/delete_instance"
```

See MorphoCloud/MorphoCloudWorkflow@d4e1ccb...e2141dd
  • Loading branch information
jcfr committed Oct 1, 2024
1 parent c75e50c commit fada2c4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
10 changes: 5 additions & 5 deletions .github/actions/control-instance/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand All @@ -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]"
Expand Down Expand Up @@ -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' || '' }}
6 changes: 4 additions & 2 deletions .github/workflows/control-instance-from-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/control-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
with:
command: "/delete"
command: "/delete_instance"
reaction: "rocket"
allowed_contexts: "issue"
permissions: "write,maintain,admin"
Expand All @@ -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"
Expand All @@ -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=""
Expand All @@ -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

Expand Down
18 changes: 9 additions & 9 deletions issue-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

0 comments on commit fada2c4

Please sign in to comment.