From 29a99757a7bec48fc3f91e0fc3315089f0fc36ac Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 29 May 2026 20:06:42 +0200 Subject: [PATCH 1/4] feat: add branding metadata to action.yml --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 79647fa..e215eba 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,8 @@ name: "AetherPak Setup CLI" description: "Download AetherPak CLI binary and install dependencies on Linux." +branding: + icon: "terminal" + color: "blue" inputs: version: description: "Version of AetherPak CLI to install (e.g., v0.2.0, latest)" From 0e96a2fa63dbbae17ad813f06aa8157f3f11e157 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 29 May 2026 20:14:16 +0200 Subject: [PATCH 2/4] feat!: improve curl safety, non-apt warnings, and add outputs BREAKING CHANGE: require Linux (Ubuntu) runners, refactor shell array execution, warn on non-apt systems, and expose version/path outputs. --- action.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index e215eba..0f6b83f 100644 --- a/action.yml +++ b/action.yml @@ -3,6 +3,13 @@ description: "Download AetherPak CLI binary and install dependencies on Linux." branding: icon: "terminal" color: "blue" +outputs: + version: + description: "Resolved version tag of AetherPak CLI" + value: ${{ steps.download.outputs.version }} + path: + description: "Directory where the AetherPak CLI binary is installed" + value: ${{ steps.download.outputs.path }} inputs: version: description: "Version of AetherPak CLI to install (e.g., v0.2.0, latest)" @@ -38,12 +45,17 @@ runs: command -v ostree >/dev/null 2>&1 || MISSING="$MISSING ostree" command -v gpg >/dev/null 2>&1 || MISSING="$MISSING gnupg" command -v flatpak-builder >/dev/null 2>&1 || MISSING="$MISSING flatpak-builder" - if [ -n "$MISSING" ] && command -v apt-get >/dev/null 2>&1; then - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update && sudo apt-get install -y $MISSING + if [ -n "$MISSING" ]; then + if command -v apt-get >/dev/null 2>&1; then + export DEBIAN_FRONTEND=noninteractive + sudo apt-get update && sudo apt-get install -y $MISSING + else + echo "::warning::Missing dependencies ($MISSING) could not be installed because 'apt-get' is not available. Please install them manually." + fi fi - name: Download AetherPak CLI + id: download shell: bash env: GH_TOKEN: ${{ github.token }} @@ -72,11 +84,11 @@ runs: fi # Fallback to public GitHub API if [ -z "$TAG" ]; then - AUTH_HEADER="" + AUTH=() if [ -n "${GH_TOKEN:-}" ]; then - AUTH_HEADER="-H \"Authorization: token $GH_TOKEN\"" + AUTH=(-H "Authorization: token $GH_TOKEN") fi - TAG=$(eval "curl -sSL $AUTH_HEADER https://api.github.com/repos/${{ inputs.repo }}/releases/latest" | jq -r '.tag_name // empty') + TAG=$(curl -sSL "${AUTH[@]}" "https://api.github.com/repos/${{ inputs.repo }}/releases/latest" | jq -r '.tag_name // empty' || true) fi # Fail if we still couldn't resolve the latest tag if [ -z "$TAG" ] || [ "$TAG" = "null" ]; then @@ -106,12 +118,12 @@ runs: fi if [ "$DOWNLOADED" = "false" ]; then - AUTH_HEADER="" + AUTH=() if [ -n "${GH_TOKEN:-}" ]; then - AUTH_HEADER="-H \"Authorization: token $GH_TOKEN\"" + AUTH=(-H "Authorization: token $GH_TOKEN") fi URL="https://github.com/${{ inputs.repo }}/releases/download/${TAG}/${ARCHIVE_NAME}" - eval "curl -fL $AUTH_HEADER -o \"$DOWNLOAD_DIR/$ARCHIVE_NAME\" \"$URL\"" + curl -fL "${AUTH[@]}" -o "$DOWNLOAD_DIR/$ARCHIVE_NAME" "$URL" fi # 4. Extract archive @@ -124,3 +136,7 @@ runs: # 6. Add to PATH echo "$INSTALL_DIR" >> "$GITHUB_PATH" echo "Successfully installed aetherpak $TAG to $INSTALL_DIR and added to GITHUB_PATH" + + # 7. Set outputs + echo "version=$TAG" >> "$GITHUB_OUTPUT" + echo "path=$INSTALL_DIR" >> "$GITHUB_OUTPUT" From 6abcfcce68c0844eb89e3e1c2792125372a1d625 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 29 May 2026 20:17:16 +0200 Subject: [PATCH 3/4] ci: add pre-commit lint configs, Makefile, and CI lint workflow --- .github/actionlint.yaml | 10 ++++++++++ .github/workflows/test.yml | 18 ++++++++++++++++++ .pre-commit-config.yaml | 25 +++++++++++++++++++++++++ Makefile | 20 ++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 .github/actionlint.yaml create mode 100644 .github/workflows/test.yml create mode 100644 .pre-commit-config.yaml create mode 100644 Makefile diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000..9ce7d06 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,10 @@ +paths: + .github/workflows/*.yml: + ignore: + # actionlint v1.7.12 ships stale metadata for create-github-app-token@v3: + # it still marks `app-id` as required and doesn't know about `client-id`. + # Upstream action.yml accepts both (only `private-key` is required) and + # deprecates `app-id`. Remove once actionlint refreshes the v3 snapshot. + - 'missing input "app-id" which is required by action "actions/create-github-app-token@v3"' + - 'input "client-id" is not defined in action "actions/create-github-app-token@v3"' + - 'property "job_workflow_ref" is not defined in object type' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0d53f86 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Test and Lint + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + name: Lint & Verify Action + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v6 + + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..cd43bdf --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +# commit-msg is needed for conventional-pre-commit; pre-commit install +# reads this so both stages get hooked. +default_install_hook_types: [pre-commit, commit-msg] + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-merge-conflict + - id: check-added-large-files + + - repo: https://github.com/rhysd/actionlint + rev: v1.7.12 + hooks: + - id: actionlint + + - repo: https://github.com/compilerla/conventional-pre-commit + rev: v4.4.0 + hooks: + - id: conventional-pre-commit + stages: [commit-msg] + args: [feat, fix, docs, style, refactor, test, chore, ci] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e7f1595 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +.DEFAULT_GOAL := help + +.PHONY: setup lint help + +##@ Bootstrap + +setup: ## Install the pre-commit git hooks + uvx pre-commit install + +##@ Quality + +lint: ## Run all pre-commit checks (actionlint, yaml, formatting) + uvx pre-commit run --all-files + +##@ Utilities + +help: ## Show this help + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} \ + /^[a-zA-Z0-9_/-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } \ + /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) }' $(MAKEFILE_LIST) From eba153ef6f9bc5f3a1a6bbd469c2fcf63684e778 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Fri, 29 May 2026 20:18:15 +0200 Subject: [PATCH 4/4] ci: rename workflow to CI and use ci.yml --- .github/workflows/{test.yml => ci.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{test.yml => ci.yml} (93%) diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 93% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index 0d53f86..94df9c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test and Lint +name: CI on: push: