You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-2
Original file line number
Diff line number
Diff line change
@@ -185,5 +185,45 @@ sequenceDiagram
185
185
186
186
187
187
### GithubAction
188
-
> :warning: WIP
189
-
The GithubAction component of this repo interacts with the LeaseProvider and determines the priority of each run based on the commits ahead of the baseRef.
188
+
The GithubAction component of this repo interacts with the LeaseProvider and determines the priority of each run based on the commits ahead of the base.
189
+
It has two stages:
190
+
1. Acquiring a lease
191
+
2. Releasing a lease when (1) has been successful, reporting the Github action job status
192
+
193
+
An example workflow can look like this:
194
+
```yaml
195
+
on:
196
+
# Trigger on PRs; here we just skip
197
+
pull_request:
198
+
branches: [ main ]
199
+
# Trigger on the merge group event
200
+
merge_group:
201
+
branches: [ main ]
202
+
types: [ checks_requested ]
203
+
204
+
jobs:
205
+
access-shared-resource:
206
+
runs-on: ubuntu-latest
207
+
if: ${{ github.event_name == 'merge_group' }}
208
+
steps:
209
+
- name: Checkout Plugin Repository
210
+
uses: actions/checkout@v3
211
+
- name: Aquire lease
212
+
id: acquire_lease
213
+
uses: ankorstore/gh-action-mq-lease-service@main
214
+
with:
215
+
# Endpoint to connect to
216
+
endpoint: https://your.lease.service.com
217
+
# **IMPORTANT** the job-status always has to be defined like this
218
+
job_status: ${{ job.status }}
219
+
# Optional: timeout_seconds (how long to wait before something is considered going wrong)
220
+
# timeout_seconds: 7200
221
+
# Optional: interval_seconds (the polling interval)
222
+
# timeout_seconds: 15
223
+
- name: sleep
224
+
# Only perform github actions when this run acquired the lease
0 commit comments