Add option to disable version check in admin web UI (#3040)

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
6543
2023-12-27 22:16:15 +01:00
committed by GitHub
parent 8280655e0f
commit 74f6824d03
8 changed files with 29 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ declare global {
interface Window {
WOODPECKER_USER: User | undefined;
WOODPECKER_VERSION: string | undefined;
WOODPECKER_SKIP_VERSION_CHECK: boolean | undefined;
WOODPECKER_CSRF: string | undefined;
WOODPECKER_FORGE: 'github' | 'gitlab' | 'gitea' | 'bitbucket' | undefined;
WOODPECKER_ROOT_PATH: string | undefined;
@@ -14,6 +15,7 @@ declare global {
export default () => ({
user: window.WOODPECKER_USER || null,
version: window.WOODPECKER_VERSION,
skipVersionCheck: window.WOODPECKER_SKIP_VERSION_CHECK || false,
csrf: window.WOODPECKER_CSRF || null,
forge: window.WOODPECKER_FORGE || null,
rootPath: window.WOODPECKER_ROOT_PATH || '',

View File

@@ -42,7 +42,7 @@ export function useVersion() {
const usesNext = current.startsWith('next');
const { user } = useAuthentication();
if (!user?.admin) {
if (config.skipVersionCheck || !user?.admin) {
version.value = {
latest: undefined,
current,