-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
66 lines (58 loc) · 1.92 KB
/
action.yml
File metadata and controls
66 lines (58 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Project: macbash
# File: action.yml
# Purpose: GitHub Action to check bash scripts for macOS compatibility
# Language: YAML (GitHub Actions)
#
# License: Apache-2.0
# Copyright: (c) 2025-2026 HYPERI PTY LIMITED
name: 'macbash'
description: 'Check bash scripts for macOS compatibility and auto-fix them for cross-platform portability'
author: 'HYPERI PTY LIMITED'
branding:
icon: 'terminal'
color: 'blue'
inputs:
version:
description: 'macbash version to install (without v prefix)'
required: false
default: '1.1.0'
paths:
description: 'Files or glob patterns to check (space-separated)'
required: false
default: '**/*.sh'
severity:
description: 'Minimum severity level: error, warning, info'
required: false
default: 'warning'
format:
description: 'Output format: text, json'
required: false
default: 'text'
runs:
using: 'composite'
steps:
- name: Install macbash
shell: bash
env:
MACBASH_VERSION: ${{ inputs.version }}
run: |
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) ARCH="amd64" ;;
aarch64) ARCH="arm64" ;;
esac
TARBALL="macbash-${MACBASH_VERSION}-${OS}-${ARCH}.tar.gz"
URL="https://github.com/hyperi-io/macbash/releases/download/v${MACBASH_VERSION}/${TARBALL}"
echo "Installing macbash v${MACBASH_VERSION} (${OS}/${ARCH})..."
curl -fsSL "$URL" -o "/tmp/${TARBALL}"
tar xzf "/tmp/${TARBALL}" -C /tmp/
install -m 755 "/tmp/macbash-${MACBASH_VERSION}-${OS}-${ARCH}/macbash" /usr/local/bin/macbash
rm -rf "/tmp/${TARBALL}" "/tmp/macbash-${MACBASH_VERSION}-${OS}-${ARCH}"
macbash --version
- name: Run macbash
shell: bash
run: |
macbash --severity "${{ inputs.severity }}" \
--format "${{ inputs.format }}" \
${{ inputs.paths }}