From 52a262b3a3fb413ac0a8db916402f291806cdd6c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 5 Dec 2024 09:41:38 -0500 Subject: [PATCH] fix: Update to MorphoCloud/MorphoCloudWorkflow@5f1d3ee List of MorphoCloudWorkflow changes: ``` $ git shortlog 605af12..5f1d3ee --no-merges Jean-Christophe Fillion-Robin (6): fix: Simplify action log links in informational messages fix(create-instance): Improve readability of control instance success message fix(validate-request): Re-organize validation status to take less vertical space fix: Remove redundant comment posted by triggering workflow feat: Append instance and volume names to issue description feat(validate-request): Simplify status report if all tests pass ``` See https://github.com/MorphoCloud/MorphoCloudWorkflow/compare/605af12...5f1d3ee --- .github/actions/control-instance/action.yml | 4 +- .../instance-creation-progress-template.md | 2 +- .../workflows/automatic-instance-shelving.yml | 4 -- .../control-instance-from-workflow.yml | 5 +-- .github/workflows/create-instance.yml | 2 - .../workflows/request-initial-comments.yml | 32 ++++----------- .github/workflows/send-email.yml | 2 - .../workflows/update-issue-from-workflow.yml | 5 +-- .github/workflows/validate-request.yml | 39 +++++++++++++------ 9 files changed, 41 insertions(+), 54 deletions(-) diff --git a/.github/actions/control-instance/action.yml b/.github/actions/control-instance/action.yml index fb090390..a0b54bd2 100644 --- a/.github/actions/control-instance/action.yml +++ b/.github/actions/control-instance/action.yml @@ -233,9 +233,7 @@ runs: body: | ### Command Results ✅ - `${{ inputs.command_name }}` command successfully applied to **${{ steps.define.outputs.instance_name }}** instance. - - See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + Instance **${{ steps.define.outputs.instance_name }}** successfully ${{ inputs.command_name }}d. - name: Update Request Status Label uses: ./.github/actions/update-request-status-label diff --git a/.github/instance-creation-progress-template.md b/.github/instance-creation-progress-template.md index 08fe0010..785125f5 100644 --- a/.github/instance-creation-progress-template.md +++ b/.github/instance-creation-progress-template.md @@ -4,4 +4,4 @@ | :--------------: | :------------------: | :--------------------: | :-----------------: | :-------------------: | :------------------: | :---------------: | | {{ .create_ip }} | {{ .create_volume }} | {{ .create_instance }} | {{ .associate_ip }} | {{ .setup_instance }} | {{ .attach_volume }} | {{ .send_email }} | -See details at {{ .details_url }} +_See details [here]({{ .details_url }})._ diff --git a/.github/workflows/automatic-instance-shelving.yml b/.github/workflows/automatic-instance-shelving.yml index 4db6aa59..40e8ce06 100644 --- a/.github/workflows/automatic-instance-shelving.yml +++ b/.github/workflows/automatic-instance-shelving.yml @@ -120,10 +120,6 @@ jobs: gh workflow run control-instance-from-workflow.yml \ -f issue_number=$issue_number \ -f command_name=shelve - gh issue comment $issue_number \ - -b "Workflow **control-instance-from-workflow.yml** triggered by **automatic-instance-shelving.yml** for command shelve
\ -
\ - For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_" fi done env: diff --git a/.github/workflows/control-instance-from-workflow.yml b/.github/workflows/control-instance-from-workflow.yml index 7ceadd96..f6671969 100644 --- a/.github/workflows/control-instance-from-workflow.yml +++ b/.github/workflows/control-instance-from-workflow.yml @@ -36,9 +36,8 @@ jobs: - name: Control instance run: | gh issue comment $ISSUE_NUMBER \ - -b "Command shelve issued by **control-instance-from-workflow.yml** workflow
\ -
\ - For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_" + -b "Command shelve issued by **control-instance-from-workflow.yml** workflow. \ + See details [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})." env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml index f0818b61..ce531511 100644 --- a/.github/workflows/create-instance.yml +++ b/.github/workflows/create-instance.yml @@ -167,8 +167,6 @@ jobs: Volume **${{ steps.define_volume_name.outputs.volume_name }}** already exists. - See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - - name: Create Volume if: ${{ ! fromJSON(steps.check_volume.outputs.exists) }} id: create_volume diff --git a/.github/workflows/request-initial-comments.yml b/.github/workflows/request-initial-comments.yml index a9dac688..7eaea6bf 100644 --- a/.github/workflows/request-initial-comments.yml +++ b/.github/workflows/request-initial-comments.yml @@ -38,18 +38,9 @@ jobs: prefix: ${{ vars.INSTANCE_NAME_PREFIX }} issue_number: ${{ steps.collect_inputs.outputs.issue_number }} - - name: Find Instance Name Comment - uses: peter-evans/find-comment@v3 - id: fc_instance_name + - name: description (instance name) + uses: julien-deramond/update-issue-body@v1.1.0 with: - issue-number: ${{ steps.collect_inputs.outputs.issue_number }} - comment-author: "github-actions[bot]" - body-includes: "### Instance Name" - - - name: comment (instance name) - uses: peter-evans/create-or-update-comment@v4.0.0 - with: - comment-id: ${{ steps.fc_instance_name.outputs.comment-id }} issue-number: ${{ steps.collect_inputs.outputs.issue_number }} body: | ### Instance Name @@ -57,7 +48,8 @@ jobs: `${{ steps.define.outputs.instance_name }}` _The instance name is derived from the GitHub issue number using the template `${{ steps.define.outputs.instance_prefix }}instance-NNN`. The instance may also be located in the exosphere interface using this name._ - edit-mode: replace + edit-mode: append + append-separator: newline - name: Define volume name id: define_volume_name @@ -66,18 +58,9 @@ jobs: issue_number: ${{ steps.collect_inputs.outputs.issue_number }} suffix: ${{ vars.VOLUME_NAME_SUFFIX }} - - name: Find Volume Name Comment - uses: peter-evans/find-comment@v3 - id: fc_volume_name + - name: description (volume name) + uses: julien-deramond/update-issue-body@v1.1.0 with: - issue-number: ${{ steps.collect_inputs.outputs.issue_number }} - comment-author: "github-actions[bot]" - body-includes: "### Volume Name" - - - name: comment (volume name) - uses: peter-evans/create-or-update-comment@v4.0.0 - with: - comment-id: ${{ steps.fc_volume_name.outputs.comment-id }} issue-number: ${{ steps.collect_inputs.outputs.issue_number }} body: | ### Volume Name @@ -85,7 +68,8 @@ jobs: `${{ steps.define_volume_name.outputs.volume_name }}` _The volume name is derived from the GitHub issue number using the template `My-Data-NNN${{ steps.define_volume_name.outputs.volume_suffix }}`. The volume may also be located in the exosphere interface using this name._ - edit-mode: replace + edit-mode: append + append-separator: newline - name: Find Issue Commands Comment uses: peter-evans/find-comment@v3 diff --git a/.github/workflows/send-email.yml b/.github/workflows/send-email.yml index 56130e55..6f58eaab 100644 --- a/.github/workflows/send-email.yml +++ b/.github/workflows/send-email.yml @@ -87,5 +87,3 @@ jobs: ### Command Results ✅ `email` command successfully completed for **${{ steps.define.outputs.instance_name }}** instance. - - See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/update-issue-from-workflow.yml b/.github/workflows/update-issue-from-workflow.yml index 0f79270c..3ca72b6e 100644 --- a/.github/workflows/update-issue-from-workflow.yml +++ b/.github/workflows/update-issue-from-workflow.yml @@ -36,9 +36,8 @@ jobs: - name: Add comment run: | gh issue comment $ISSUE_NUMBER \ - -b "Command ${COMMAND_NAME} issued by **update-issue-from-workflow.yml** workflow
\ -
\ - For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_" + -b "Command ${COMMAND_NAME} issued by **update-issue-from-workflow.yml** workflow. \ + See details [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})." env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} diff --git a/.github/workflows/validate-request.yml b/.github/workflows/validate-request.yml index 992bb461..5a634f2f 100644 --- a/.github/workflows/validate-request.yml +++ b/.github/workflows/validate-request.yml @@ -172,10 +172,6 @@ jobs: gh workflow run update-issue-from-workflow.yml \ -f issue_number=$ISSUE_NUMBER \ -f command_name=$COMMAND_NAME - gh issue comment $ISSUE_NUMBER \ - -b "Workflow **update-issue-from-workflow.yml** triggered by **validate-request.yml** for command $COMMAND_NAME
\ -
\ - For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}_" env: ISSUE_NUMBER: ${{ steps.collect_inputs.outputs.issue_number }} COMMAND_NAME: encode_email @@ -194,7 +190,29 @@ jobs: See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - name: command results comment (status) - if: ${{ success() }} + if: + ${{ success() && (steps.check_orcid_format.outputs.valid == 'true' && + steps.check_email_format.outputs.valid == 'true' && + steps.check_confirm_email_format.outputs.valid == 'true' && + steps.check_emails_match.outputs.valid == 'true') }} + uses: peter-evans/create-or-update-comment@v4.0.0 + with: + issue-number: ${{ steps.collect_inputs.outputs.issue_number }} + body: | + ### Validation Results + + The validation checks have completed. Below is the status of each check: + + | Check | ORCID iD format | Email format | Confirm Email format | Emails match | + | ----------------------- |:----------------------------------------------:|:----------------------------------------------:|:------------------------------------------------------:|:----------------------------------------------:| + | Status | ${{ steps.check_orcid_format.outputs.emojii }} | ${{ steps.check_email_format.outputs.emojii }} | ${{ steps.check_confirm_email_format.outputs.emojii }} | ${{ steps.check_emails_match.outputs.emojii }} | + + - name: command results comment (status) + if: + ${{ success() && (steps.check_orcid_format.outputs.valid == 'false' || + steps.check_email_format.outputs.valid == 'false' || + steps.check_confirm_email_format.outputs.valid == 'false' || + steps.check_emails_match.outputs.valid == 'false') }} uses: peter-evans/create-or-update-comment@v4.0.0 with: issue-number: ${{ steps.collect_inputs.outputs.issue_number }} @@ -203,12 +221,9 @@ jobs: The validation checks have completed. Below is the status of each check: - | Check | Status | - | ----------------------- |:-------:| - | ORCID iD format | ${{ steps.check_orcid_format.outputs.emojii }} | - | Email format | ${{ steps.check_email_format.outputs.emojii }} | - | Confirm Email format | ${{ steps.check_confirm_email_format.outputs.emojii }} | - | Emails match | ${{ steps.check_emails_match.outputs.emojii }} | | + | Check | ORCID iD format | Email format | Confirm Email format | Emails match | + | ----------------------- |:----------------------------------------------:|:----------------------------------------------:|:------------------------------------------------------:|:----------------------------------------------:| + | Status | ${{ steps.check_orcid_format.outputs.emojii }} | ${{ steps.check_email_format.outputs.emojii }} | ${{ steps.check_confirm_email_format.outputs.emojii }} | ${{ steps.check_emails_match.outputs.emojii }} | > [!IMPORTANT] > If the ORCID iD format is incorrect, edit the issue description to correct it. @@ -218,4 +233,4 @@ jobs: > [!TIP] > Once the emails are correctly formatted and match, they will be automatically obfuscated for security. - See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + See details [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).