WIP: fix: shellcheck assertions, POSIX compliance #101

Draft
crueter wants to merge 10 commits from crueter/forgejo-release:shellcheck into main
Contributor

Mostly just quoting; now shellcheck won't try to murder me everytime I
open this file

For POSIX compliance, moved some [[ to [ (maintaining proper null checks). Also use set -- for the asset array, and prefer command -v over which.

Signed-off-by: crueter crueter@eden-emu.dev

Mostly just quoting; now shellcheck won't try to murder me everytime I open this file For POSIX compliance, moved some `[[` to `[` (maintaining proper null checks). Also use `set --` for the asset array, and prefer `command -v` over `which`. Signed-off-by: crueter <crueter@eden-emu.dev>
fix: all shellcheck assertions
Some checks failed
/ integration (pull_request) Has been cancelled
/ tests (pull_request) Has been cancelled
4e9e207cf5
Mostly just quoting; now shellcheck won't try to murder me everytime I
open this file

Signed-off-by: crueter <crueter@eden-emu.dev>
POSIX compliance
Some checks failed
/ integration (pull_request) Has been cancelled
/ tests (pull_request) Has been cancelled
d5e77e0b90
Signed-off-by: crueter <crueter@eden-emu.dev>
more fix
Some checks failed
/ integration (pull_request) Has been cancelled
/ tests (pull_request) Has been cancelled
3dd816beaa
Signed-off-by: crueter <crueter@eden-emu.dev>
crueter changed title from fix: all shellcheck assertions to fix: shellcheck assertions, POSIX compliance 2025-11-15 03:45:50 +00:00
posix-compliant setup_api + more distros
Some checks failed
/ integration (pull_request) Has been cancelled
/ tests (pull_request) Has been cancelled
b79fc25443
Signed-off-by: crueter <crueter@eden-emu.dev>
prefer [] over test
Some checks failed
/ integration (pull_request) Has been cancelled
/ tests (pull_request) Has been cancelled
eeadd646e2
Signed-off-by: crueter <crueter@eden-emu.dev>
@ -52,3 +52,3 @@
local sha=$(jq --raw-output .commit.sha <"$TAG_FILE")
sha=$(jq --raw-output .commit.sha <"$TAG_FILE")
test "$sha" = "$SHA"
else
Owner

why local removal? now sha will propagate to caller

why local removal? now sha will propagate to caller
Author
Contributor

local is not POSIX compliant. If there's a conflcting variable in a caller we can rename this.

`local` is not POSIX compliant. If there's a conflcting variable in a caller we can rename this.
crueter marked this conversation as resolved
@ -113,3 +116,3 @@
local id=$(api GET repos/$REPO/releases/tags/"$TAG_URL" | jq --raw-output .id)
id=$(api GET "repos/$REPO/releases/tags/$TAG_URL" | jq --raw-output .id)
Owner

same here?

same here?
crueter marked this conversation as resolved
Owner

btw: this is not enough

shell: bash

btw: this is not enough https://code.forgejo.org/actions/forgejo-release/src/commit/e5e095057ad31a74545a14e483836221df9e4648/action.yml#L67
Author
Contributor

@viceice wrote in #101 (comment):

btw: this is not enough

action.yml
Line 67 in e5e0950
shell: bash

Wdym? We can change this to sh without issue

EDIT: nvm I see now

@viceice wrote in https://code.forgejo.org/actions/forgejo-release/pulls/101#issuecomment-67516: > btw: this is not enough > > [action.yml](https://code.forgejo.org/actions/forgejo-release/src/commit/e5e095057ad31a74545a14e483836221df9e4648/action.yml#L67) > Line 67 in [e5e0950](https://code.forgejo.org/actions/forgejo-release/src/commit/e5e095057ad31a74545a14e483836221df9e4648) > ` shell: bash ` Wdym? We can change this to sh without issue EDIT: nvm I see now
better locals names, POSIX compliant action.yml
Some checks failed
/ tests (pull_request) Failing after 7s
/ integration (pull_request) Failing after 3m40s
8fd044737f
Signed-off-by: crueter <crueter@eden-emu.dev>
fix empty gpg passphrase file
Some checks failed
/ tests (pull_request) Failing after 6s
/ integration (pull_request) Failing after 4m11s
7e30abe47f
Signed-off-by: crueter <crueter@eden-emu.dev>
fix
Some checks failed
/ tests (pull_request) Successful in 8s
/ integration (pull_request) Failing after 3m38s
f2b08a736d
Signed-off-by: crueter <crueter@eden-emu.dev>
fix setup_api
Some checks failed
/ tests (pull_request) Successful in 10s
/ integration (pull_request) Failing after 3m41s
ee3240803a
Signed-off-by: crueter <crueter@eden-emu.dev>
printf args
Some checks failed
/ tests (pull_request) Successful in 10s
/ integration (pull_request) Failing after 7m11s
2913807d7e
Signed-off-by: crueter <crueter@eden-emu.dev>
Author
Contributor

I have no idea why integrations is failing. That log is impossible to read.

I have no idea why integrations is failing. That log is impossible to read.
crueter changed title from fix: shellcheck assertions, POSIX compliance to WIP: fix: shellcheck assertions, POSIX compliance 2025-11-27 18:27:35 +00:00
Some checks failed
/ tests (pull_request) Successful in 10s
Required
Details
/ integration (pull_request) Failing after 7m11s
Required
Details
This pull request has changes conflicting with the target branch.
  • action.yml
  • forgejo-release.sh
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u shellcheck:crueter-shellcheck
git switch crueter-shellcheck
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
actions/forgejo-release!101
No description provided.