Is there a way to check if a stack is currently lo...
# automation-api
a
Is there a way to check if a stack is currently locked? eg if I wanted to block deploying a commit within github actions until an earlier deploy had finished
🙏 1
(@brave-planet-10645 I’m looking at ways to keep it to one stack per PR)
b
Interesting idea. Let me find out
👍 2
l
The result property of the latest update summary will indicate whether or not an update is currently running or has finished https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/auto#UpdateSummary
Copy code
{
    "version": 2,
    "kind": "update",
    "startTime": "2021-08-10T16:45:19.000Z",
    "message": "",
    "environment": {
      "exec.kind": "cli"
    },
    "config": {},
    "result": "in-progress"
  },
  {
    "version": 1,
    "kind": "update",
    "startTime": "2021-08-10T16:41:59.000Z",
    "message": "",
    "environment": {
      "exec.kind": "cli"
    },
    "config": {},
    "result": "succeeded",
    "endTime": "2021-08-10T16:44:32.000Z",
    "resourceChanges": {
      "create": 1
    }
  }
p
we use turnstyle
Copy code
- name: Turnstyle
        if: ${{ github.event_name == 'push' }}
        uses: softprops/turnstyle@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
b
Evan beat me to it, but that was what I was about to post
@proud-pizza-80589 that looks awesome, thanks for posting.
p
i got it from the pulumi docs TBH, but it got removed there https://github.com/pulumi/docs/pull/4410
a
Fantastic! Thanks all, I’ll take a look