guibranco / guibranco/github-artifact-lock-action
Consider using conditional `if` on release action in examples
- Dominant language
- No language data
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### What would you like to share?
First of all, thank you for creating this action. I am incorporating into my own GitHub action and wanted to suggest that defaults (IIUC) in the example scripts might release another execution's lock, if they themselves fail to acquire it.
Current example:
```
- name: Acquire deployment lock 🔐
uses: guibranco/github-artifact-lock-action@v2.0.5
with:
lock-name: staging-environment-lock
wait-seconds: 30
max-attempts: 20
- name: Deploy to staging 🚀
run: ./deploy.sh --env staging
- name: Release deployment lock 🔓
if: always()
uses: guibranco/github-artifact-lock-action/release-lock@v2.0.5
with:
lock-name: staging-environment-lock
```
I wonder if this would be better:
```
- name: Acquire deployment lock 🔐
id: acquire-lock
uses: guibranco/github-artifact-lock-action@v2.0.5
with:
lock-name: staging-environment-lock
wait-seconds: 30
max-attempts: 20
- name: Deploy to staging 🚀
run: ./deploy.sh --env staging
- name: Release deployment lock 🔓
if: always() && steps.acquire-lock.outcome == 'success'
uses: guibranco/github-artifact-lock-action/release-lock@v2.0.5
with:
lock-name: staging-environment-lock
```
Wdyt?
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.