italia / italia/publiccode-softwareversion-check-action
Shouldn't the action fail when there's nothing to update?
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
From the example in README.md:
```
[...]
- name: Parse publiccode.yml
uses: italia/publiccode-softwareversion-check-action
id: pva
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
if: failure()
with:
title: "feat: update softwareVersion ${{ steps.pva.outputs.version }} in publiccode.yml"
branch: feature/publiccode-${{ steps.pva.outputs.version }}
```
The `if: failure()` feels a bit odd. If the action succeeds, that should mean it updated the file IMO, so the PR step could just run as part of the normal flow.
Maybe the logic could be flipped so there's no need for `failure()`, which would make the workflow simpler and more intuitive.
Also it won't create a new PR when the action actually fails for some other reason.
The workflow definition would look less surprising:
```
- uses: italia/publiccode-softwareversion-check-action
- uses: peter-evans/create-pull-request@v3
with:
title "feat: update softwareVersion"
```
Contributor guide
Assessment
This issue has not been assessed yet.