mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-12 06:47:18 +08:00
# Requirements Updated - "humanize==4.13.0" - "ruff==0.12.11" # Breaking Changes - **DEPRECATE `QBT_CONFIG` / `--config-file` OPTION** - No longer supporting `QBT_CONFIG` / `--config-file`. Instead please switch over to **`QBT_CONFIG_DIR` / `--config-dir`**. - `QBT_CONFIG` / `--config-file` option will still work for now but is now considered legacy and will be removed in a future release. - **Note**: All yml/yaml files will be treated as valid configuration files and loaded in the `QBT_CONFIG_DIR` path. Please ensure you **remove** any old/unused configurations that you don't want to be loaded prior to using this path. # Improvements - Adds docker support for PUID/PGID environment variables - Dockerfile copies the latest `config.yml.sample` in the config folder - Add `QBT_HOST` / `--host` option to specify webUI host address (#929 Thanks to @QuixThe2nd) - WebUI: Quick action settings persist now # Bug Fixes - WebUI: Fix loading spinner to be centered in the webUI **Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.5.5...v4.6.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Fabricio Silva <hi@fabricio.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Parsa Yazdani <parsa@yazdani.au> Co-authored-by: Actionbot <actions@github.com>
62 lines
2.5 KiB
Bash
Executable file
62 lines
2.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Detect if running in CI (e.g., GitHub Actions or pre-commit.ci)
|
|
if [[ -n "$GITHUB_ACTIONS" || -n "$CI" || -n "$PRE_COMMIT_CI" ]]; then
|
|
IN_CI=true
|
|
else
|
|
IN_CI=false
|
|
fi
|
|
# CI: For pull_request events, check if the PR itself changes VERSION.
|
|
# If not, run the develop version updater. This avoids relying on staged files.
|
|
if [[ "$IN_CI" == "true" ]]; then
|
|
# Check if VERSION file contains "develop"
|
|
if ! grep -q "develop" VERSION; then
|
|
echo "VERSION file does not contain 'develop'. Skipping version update."
|
|
exit 0
|
|
fi
|
|
|
|
# Check if VERSION differs from develop branch
|
|
if git diff --quiet origin/develop...HEAD -- VERSION 2>/dev/null; then
|
|
echo "VERSION file is the same as in develop branch. User didn't bump version, so updating develop version."
|
|
source "$(dirname "$0")/update_develop_version.sh"
|
|
else
|
|
echo "VERSION file differs from develop branch. User already bumped version. Skipping update."
|
|
fi
|
|
exit 0
|
|
fi
|
|
|
|
# When running locally during an actual commit, skip if nothing is staged.
|
|
# In CI, pre-commit typically runs outside of a commit with no staged files,
|
|
# so we must not early-exit there.
|
|
if [[ "$IN_CI" != "true" && -z $(git diff --cached --name-only) ]]; then
|
|
echo "There are no changes staged for commit. Skipping version update."
|
|
exit 0
|
|
fi
|
|
|
|
# For local development, check if VERSION contains "develop"
|
|
if [[ "$IN_CI" != "true" ]]; then
|
|
# Check if VERSION file contains "develop"
|
|
if ! grep -q "develop" VERSION; then
|
|
echo "VERSION file does not contain 'develop'. Skipping version update."
|
|
exit 0
|
|
# Check if the VERSION file is staged for modification
|
|
elif git diff --cached --name-only | grep -q "VERSION"; then
|
|
echo "The VERSION file is already modified. Skipping version update."
|
|
exit 0
|
|
elif git diff --name-only | grep -q "VERSION"; then
|
|
echo "The VERSION file has unstaged changes. Please stage them before committing."
|
|
exit 0
|
|
fi
|
|
fi
|
|
|
|
# Check if we should run version update
|
|
if ! git diff --quiet origin/develop -- VERSION 2>/dev/null; then
|
|
# VERSION differs from develop branch, so we should update it
|
|
source "$(dirname "$0")/update_develop_version.sh"
|
|
elif [[ -n "$(git diff --cached --name-only)" ]] && ! git diff --cached --name-only | grep -q "VERSION"; then
|
|
# There are staged changes but VERSION is not among them
|
|
source "$(dirname "$0")/update_develop_version.sh"
|
|
elif ! git show --name-only HEAD | grep -q "VERSION"; then
|
|
# VERSION doesn't exist in HEAD (new file)
|
|
source "$(dirname "$0")/update_develop_version.sh"
|
|
fi
|