Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Nov 2, 2023
1 parent 29f9107 commit 57b36dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ jobs:
role-to-assume: ${{ secrets.AWS_ROLE }}

- id: lock-1
name: Acquire for 10s
name: Acquire a lock
uses: ./
with:
name: ${{ env.LOCK_NAME }}
s3-bucket: ${{ env.S3_BUCKET }}
bucket: ${{ env.S3_BUCKET }}
expires: 5s

- id: lock-2
name: Wait on lock-1 then acquire
name: Wait on previous lock then acquire our own
uses: ./
with:
name: ${{ env.LOCK_NAME }}
s3-bucket: ${{ env.S3_BUCKET }}
bucket: ${{ env.S3_BUCKET }}
timeout: 10s

- name: Verify locks
Expand All @@ -76,5 +76,5 @@ jobs:
uses: ./
with:
name: ${{ env.LOCK_NAME }}
s3-bucket: ${{ env.S3_BUCKET }}
bucket: ${{ env.S3_BUCKET }}
timeout: 0s
19 changes: 11 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ description: Wait on, acquire, and clean-up S3-based locks
author: "Freckle"
inputs:
name:
description: "Name for the lock"
description: |
Name for the lock object. Include any prefix you want within the bucket.
The key will be built as "name.created.uuid.expires".
required: true
s3-bucket:
description: "Name of existing S3 bucket to use. If empty, one will be created."
bucket:
description: |
Name of an existing S3 bucket to use.
required: true
expires:
description: |
How long to acquire the lock for. Default is 15m.
How long before concurrent operations consider this lock expired.
required: true
default: 15m
timeout:
Expand All @@ -20,14 +23,14 @@ inputs:
required: false
timeout-poll:
description: |
How long to wait between checks for the lock. Default is 5s.
How long to wait between attempts for the lock. Default is 5s.
required: true
default: 5s

outputs:
key:
description: "Key of the S3 object representing the lock"
acquired-at:
description: "Timestamp of acquisition, or null"

description: "Timestamp the lock was acquired"
runs:
using: "node20"
main: "dist/acquire/index.js"
Expand Down

0 comments on commit 57b36dd

Please sign in to comment.