Skip to content

Commit

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

```
$ git shortlog d5be05b..df8cf75 --no-merges
Jean-Christophe Fillion-Robin (1):
      fix: Use "github/lock" instead of invalid "actions/lock"
```

See MorphoCloud/MorphoCloudWorkflow@d5be05b...df8cf75
  • Loading branch information
jcfr committed Feb 4, 2025
1 parent c39bb51 commit 8ca6ec8
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 82 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/control-instance-from-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ jobs:
control:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- name: Acquire lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
inputs.issue_number }}
timeout: 3600
mode: lock

- uses: actions/checkout@v4

- name: Control instance
run: |
Expand All @@ -69,10 +69,10 @@ jobs:
mail_server_password: ${{secrets.MAIL_PASSWORD}}

- name: Release lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
inputs.issue_number }}
action: unlock
mode: unlock
23 changes: 11 additions & 12 deletions .github/workflows/control-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
contains(github.event.comment.body, '/shelve') ||
contains(github.event.comment.body, '/delete_instance') ) }}
steps:
- name: Acquire lock
uses: github/lock@v2
if: always()
with:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
mode: lock

- name: unshelve command
id: unshelve_command
Expand Down Expand Up @@ -90,15 +98,6 @@ jobs:

- uses: actions/checkout@v4

- name: Acquire lock
uses: actions/lock@v2
if: always()
with:
path:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
timeout: 3600

- name: Control instance
id: control_instance
if: ${{ steps.command.outputs.continue == 'true' }}
Expand All @@ -114,10 +113,10 @@ jobs:
mail_server_password: ${{secrets.MAIL_PASSWORD}}

- name: Release lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
action: unlock
mode: unlock
23 changes: 11 additions & 12 deletions .github/workflows/create-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
${{ !github.event.issue.pull_request && (
contains(github.event.comment.body, '/create') ) }}
steps:
- name: Acquire lock
uses: github/lock@v2
if: always()
with:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
mode: lock

- name: create command
id: create_command
Expand All @@ -28,15 +36,6 @@ jobs:

- uses: actions/checkout@v4

- name: Acquire lock
uses: actions/lock@v2
if: always()
with:
path:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
timeout: 3600

- name: Add "request:approved" label
uses: actions/github-script@v7
with:
Expand Down Expand Up @@ -700,10 +699,10 @@ jobs:
send_email:

- name: Release lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
action: unlock
mode: unlock
23 changes: 11 additions & 12 deletions .github/workflows/delete-instance-and-volume.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
${{ !github.event.issue.pull_request && (
contains(github.event.comment.body, '/delete_all') ) }}
steps:
- name: Acquire lock
uses: github/lock@v2
if: always()
with:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
mode: lock

- name: delete_instance_and_volume command
id: delete_instance_and_volume_command
Expand All @@ -28,15 +36,6 @@ jobs:

- uses: actions/checkout@v4

- name: Acquire lock
uses: actions/lock@v2
if: always()
with:
path:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
timeout: 3600

- name: Delete volume
id: delete_volume
if:
Expand Down Expand Up @@ -66,10 +65,10 @@ jobs:
mail_server_password: ${{secrets.MAIL_PASSWORD}}

- name: Release lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
action: unlock
mode: unlock
24 changes: 11 additions & 13 deletions .github/workflows/delete-volume.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ jobs:
${{ !github.event.issue.pull_request && (
contains(github.event.comment.body, '/delete_volume') ) }}
steps:

- name: Acquire lock
uses: github/lock@v2
if: always()
with:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
mode: lock

- name: delete_volume command
id: delete_volume_command
Expand All @@ -29,15 +36,6 @@ jobs:

- uses: actions/checkout@v4

- name: Acquire lock
uses: actions/lock@v2
if: always()
with:
path:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
timeout: 3600

- name: Delete volume
id: delete_volume
if: ${{ steps.delete_volume_command.outputs.continue == 'true' }}
Expand All @@ -49,10 +47,10 @@ jobs:
volume_name_suffix: ${{ vars.VOLUME_NAME_SUFFIX }}

- name: Release lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
action: unlock
mode: unlock
16 changes: 8 additions & 8 deletions .github/workflows/update-issue-from-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ jobs:
control:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- name: Acquire lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
inputs.issue_number }}
timeout: 3600
mode: lock

- uses: actions/checkout@v4

- name: Add comment
run: |
Expand All @@ -62,10 +62,10 @@ jobs:
string_encryption_key: ${{ secrets.STRING_ENCRYPTION_KEY }}

- name: Release lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
inputs.issue_number }}
action: unlock
mode: unlock
16 changes: 8 additions & 8 deletions .github/workflows/update-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ jobs:
"${{ vars.MORPHOCLOUD_GITHUB_ADMINS }},${{
github.event.issue.user.login }}"

- uses: actions/checkout@v4

- name: Acquire lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
timeout: 3600
mode: lock

- name: Set command metadata
id: command
Expand Down Expand Up @@ -83,6 +81,8 @@ jobs:
DECODE_EMAIL_COMMAND_CONTINUE:
${{ steps.decode_email_command.outputs.continue }}

- uses: actions/checkout@v4

- name: Update issue description
if: ${{ steps.command.outputs.continue == 'true' }}
uses: ./.github/actions/update-issue-description
Expand All @@ -93,10 +93,10 @@ jobs:
string_encryption_key: ${{ secrets.STRING_ENCRYPTION_KEY }}

- name: Release lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
github.event.issue.number }}
action: unlock
mode: unlock
20 changes: 11 additions & 9 deletions .github/workflows/validate-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ on:
description: "Issue number"
required: true

# Permissions needed for reacting to IssueOps commands on issues
permissions:
# Permissions needed for reacting to IssueOps commands on issues
issues: write
checks: read
# Permissions needed for lock/unlock
contents: write

jobs:
validate:
Expand All @@ -36,16 +38,16 @@ jobs:
env:
EVENT_NAME: ${{ github.event_name }}

- uses: actions/checkout@v4

- name: Acquire lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
steps.collect_inputs.outputs.issue_number }}
timeout: 3600
mode: lock

- uses: actions/checkout@v4

- name: Extract fields
id: extract
Expand Down Expand Up @@ -245,10 +247,10 @@ jobs:
See details [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
- name: Release lock
uses: actions/lock@v2
uses: github/lock@v2
if: always()
with:
path:
environment:
lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{
steps.collect_inputs.outputs.issue_number }}
action: unlock
mode: unlock

0 comments on commit 8ca6ec8

Please sign in to comment.