From e67d0c73e351806d27c6b32cb24945781f1dc9c1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 2 May 2024 16:27:35 -0400 Subject: [PATCH] wip: Update labels on instance creation --- .github/workflows/create-instance.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml index d7c9c1ea..19c2d071 100644 --- a/.github/workflows/create-instance.yml +++ b/.github/workflows/create-instance.yml @@ -13,6 +13,18 @@ jobs: runs-on: self-hosted if: github.event.label.name == 'instance:approved' steps: + - name: Remove "instance:approved" label + if: ${{ always() }} + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.removeLabel({ + issue_number: context.payload.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: ["instance:approved"] + }) + - name: Issue Forms Body Parser id: parse uses: zentered/issue-forms-body-parser@v2.0.0 @@ -102,3 +114,15 @@ jobs: "[MorphoCloudPortal] Instance ${{ github.event.issue.number }} created" body: Instance ${{ github.event.issue.number }} created + + - name: Add "instance:created" label + if: ${{ success() }} + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.payload.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: ["instance:created"] + })