Skip to content

fix: address shellcheck warnings and improve script robustness #23

fix: address shellcheck warnings and improve script robustness

fix: address shellcheck warnings and improve script robustness #23

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -y ufw curl shellcheck
- name: Run ShellCheck
run: |
shellcheck cloudflare-ufw-updater.sh
- name: Prepare environment for tests
run: |
# Mock UFW for testing
sudo mv /usr/sbin/ufw /usr/sbin/ufw.real || true
sudo touch /usr/sbin/ufw
sudo chmod +x /usr/sbin/ufw
- name: Run tests
run: |
# Run the script with test arguments
./cloudflare-ufw-updater.sh
./cloudflare-ufw-updater.sh --restore
- name: Restore environment
if: always()
run: |
# Restore original UFW
sudo mv /usr/sbin/ufw.real /usr/sbin/ufw || true