Skip to content

Commit

Permalink
wip: Update instance label only if creation is effectively completed
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed May 4, 2024
1 parent 9a947b9 commit f369ee8
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/create-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ 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/[email protected]
Expand Down Expand Up @@ -165,11 +153,17 @@ jobs:
body:
Instance ${{ steps.instance_create.outputs.instance_name }} created

- name: Add "instance:created" label
if: ${{ success() }}
- name: Update instance label (approved -> created)
if: ${{ success() && steps.instance_poll.outputs.status == 'complete' }}
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"]
})
github.rest.issues.addLabels({
issue_number: context.payload.issue.number,
owner: context.repo.owner,
Expand Down

0 comments on commit f369ee8

Please sign in to comment.