diff --git a/.github/workflows/control-instance-from-workflow.yml b/.github/workflows/control-instance-from-workflow.yml index c5163b0e..b60f37c7 100644 --- a/.github/workflows/control-instance-from-workflow.yml +++ b/.github/workflows/control-instance-from-workflow.yml @@ -35,10 +35,8 @@ 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: @@ -46,6 +44,8 @@ jobs: inputs.issue_number }} timeout: 3600 + - uses: actions/checkout@v4 + - name: Control instance run: | gh issue comment $ISSUE_NUMBER \ @@ -69,7 +69,7 @@ jobs: mail_server_password: ${{secrets.MAIL_PASSWORD}} - name: Release lock - uses: actions/lock@v2 + uses: github/lock@v2 if: always() with: path: diff --git a/.github/workflows/control-instance.yml b/.github/workflows/control-instance.yml index f9df227d..2f76473a 100644 --- a/.github/workflows/control-instance.yml +++ b/.github/workflows/control-instance.yml @@ -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: + path: + lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{ + github.event.issue.number }} + timeout: 3600 - name: unshelve command id: unshelve_command @@ -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' }} @@ -114,7 +113,7 @@ jobs: mail_server_password: ${{secrets.MAIL_PASSWORD}} - name: Release lock - uses: actions/lock@v2 + uses: github/lock@v2 if: always() with: path: diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml index c3283d30..94b8a4d6 100644 --- a/.github/workflows/create-instance.yml +++ b/.github/workflows/create-instance.yml @@ -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: + path: + lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{ + github.event.issue.number }} + timeout: 3600 - name: create command id: create_command @@ -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: @@ -700,7 +699,7 @@ jobs: send_email: ✅ - name: Release lock - uses: actions/lock@v2 + uses: github/lock@v2 if: always() with: path: diff --git a/.github/workflows/delete-instance-and-volume.yml b/.github/workflows/delete-instance-and-volume.yml index 177c9d5d..0cf8eb42 100644 --- a/.github/workflows/delete-instance-and-volume.yml +++ b/.github/workflows/delete-instance-and-volume.yml @@ -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: + path: + lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{ + github.event.issue.number }} + timeout: 3600 - name: delete_instance_and_volume command id: delete_instance_and_volume_command @@ -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: @@ -66,7 +65,7 @@ jobs: mail_server_password: ${{secrets.MAIL_PASSWORD}} - name: Release lock - uses: actions/lock@v2 + uses: github/lock@v2 if: always() with: path: diff --git a/.github/workflows/delete-volume.yml b/.github/workflows/delete-volume.yml index 423005f7..008cf133 100644 --- a/.github/workflows/delete-volume.yml +++ b/.github/workflows/delete-volume.yml @@ -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: + path: + lock-${{ vars.MORPHOCLOUD_OS_CLOUD }}-instance-${{ + github.event.issue.number }} + timeout: 3600 - name: delete_volume command id: delete_volume_command @@ -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' }} @@ -49,7 +47,7 @@ jobs: volume_name_suffix: ${{ vars.VOLUME_NAME_SUFFIX }} - name: Release lock - uses: actions/lock@v2 + uses: github/lock@v2 if: always() with: path: diff --git a/.github/workflows/update-issue-from-workflow.yml b/.github/workflows/update-issue-from-workflow.yml index 4616f8ee..68d76440 100644 --- a/.github/workflows/update-issue-from-workflow.yml +++ b/.github/workflows/update-issue-from-workflow.yml @@ -31,10 +31,8 @@ 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: @@ -42,6 +40,8 @@ jobs: inputs.issue_number }} timeout: 3600 + - uses: actions/checkout@v4 + - name: Add comment run: | gh issue comment $ISSUE_NUMBER \ @@ -62,7 +62,7 @@ jobs: string_encryption_key: ${{ secrets.STRING_ENCRYPTION_KEY }} - name: Release lock - uses: actions/lock@v2 + uses: github/lock@v2 if: always() with: path: diff --git a/.github/workflows/update-issue.yml b/.github/workflows/update-issue.yml index 1a97b15d..8dbefae6 100644 --- a/.github/workflows/update-issue.yml +++ b/.github/workflows/update-issue.yml @@ -44,10 +44,8 @@ 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: @@ -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 @@ -93,7 +93,7 @@ jobs: string_encryption_key: ${{ secrets.STRING_ENCRYPTION_KEY }} - name: Release lock - uses: actions/lock@v2 + uses: github/lock@v2 if: always() with: path: diff --git a/.github/workflows/validate-request.yml b/.github/workflows/validate-request.yml index d244ada0..88f1a382 100644 --- a/.github/workflows/validate-request.yml +++ b/.github/workflows/validate-request.yml @@ -36,10 +36,8 @@ 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: @@ -47,6 +45,8 @@ jobs: steps.collect_inputs.outputs.issue_number }} timeout: 3600 + - uses: actions/checkout@v4 + - name: Extract fields id: extract uses: ./.github/actions/extract-issue-fields @@ -245,7 +245,7 @@ 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: