Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"printWidth": 120
}
1 change: 0 additions & 1 deletion .prettierrc.yml

This file was deleted.

63 changes: 21 additions & 42 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 31 additions & 39 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,48 @@
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import globals from 'globals';
import importPlugin from 'eslint-plugin-import';
import vitestPlugin from '@vitest/eslint-plugin';

export default tseslint.config(
{
ignores: [
'**/eslint.config.js',
'**/vite.config.ts',
'**/dist/',
'**/coverage/',
'**/.yarn/',
'.pnp.cjs',
'.pnp.loader.mjs',
'package.json'
],
},
eslint.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
{
files: ['test/**/*.test.ts', 'src/**/*.ts'],
languageOptions: {
parser: tseslint.parser,
globals: {
...globals.node
}
ignores: ['dist/**', 'node_modules/**', 'coverage/**', '.yarn/**', '*.js', '*.cjs', '*.mjs', '!eslint.config.js'],
},
{
plugins: {
import: importPlugin,
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'func-style': ['error', 'expression', { allowArrowFunctions: true }],
'import/group-exports': 'error',
},
},
{
files: ['test/**/*.test.ts'],
plugins: {
'@typescript-eslint': tseslint.plugin
vitest: vitestPlugin,
},
rules: {
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': [
'no-restricted-syntax': [
'error',
{
'ts-ignore': 'allow-with-description'
}
selector: 'ImportDeclaration:not([importKind="type"])[source.value=vitest]',
message: 'Utilities from Vitest are available as globals and should not be imported',
},
],
'no-console': 'error',
'yoda': 'error',
'prefer-const': [
'vitest/no-restricted-vi-methods': [
'error',
{
destructuring: 'all'
}
mock: 'vi.mock is hoisted which can cause hard-to-debug errors. Prefer vi.doMock',
},
],
'no-control-regex': 'off',
'no-constant-condition': ['error', {checkLoops: false}]
}
});
},
}
);
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"type": "module",
"scripts": {
"build": "vite build",
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.yml --write \"**/*.{ts,yml,yaml}\"",
"format:check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.yml --check \"**/*.{ts,yml,yaml}\"",
"format": "prettier --no-error-on-unmatched-pattern --write \"**/*.{ts,yml,yaml}\"",
"format:check": "prettier --no-error-on-unmatched-pattern --check \"**/*.{ts,yml,yaml}\"",
"lint": "eslint --fix",
"lint:check": "eslint",
"prerelease": "yarn build",
Expand Down Expand Up @@ -37,16 +37,15 @@
"semver": "7.7.4"
},
"devDependencies": {
"@eslint-community/eslint-utils": "4.9.1",
"@eslint/js": "10.0.1",
"@types/node": "25.2.2",
"@types/semver": "7.7.1",
"@typescript-eslint/eslint-plugin": "8.55.0",
"@typescript-eslint/parser": "8.55.0",
"@vitest/coverage-v8": "4.0.18",
"@vitest/eslint-plugin": "1.6.7",
"eslint": "10.0.0",
"eslint-config-prettier": "10.1.8",
"globals": "17.3.0",
"eslint-plugin-import": "2.32.0",
"nock": "14.0.11",
"prettier": "3.8.1",
"tslib": "2.8.1",
Expand Down
4 changes: 2 additions & 2 deletions src/cleanup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function run() {
const run = () => {
// Nothing to do here
}
};

if (process.argv[1].endsWith("cleanup.js")) {
run();
Expand Down
42 changes: 29 additions & 13 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
/** Action input - version spec */
export const INPUT_PRODUCT_VERSION = "version";
const INPUT_PRODUCT_VERSION = "version";
/** Action input - edition */
export const INPUT_EDITION = "edition";
const INPUT_EDITION = "edition";
/** Action input - architecture */
export const INPUT_PRODUCT_ARCH = "architecture";
const INPUT_PRODUCT_ARCH = "architecture";
/** Action input - platform */
export const INPUT_PRODUCT_PLATFORM = "platform";
const INPUT_PRODUCT_PLATFORM = "platform";
/** Action input - email for auth */
export const INPUT_EMAIL = "email";
const INPUT_EMAIL = "email";
/** Action input - token for auth */
export const INPUT_TOKEN = "token";
const INPUT_TOKEN = "token";
/** Action input - EULA agreement for auth */
export const INPUT_EULA = "i-agree-to-the-eula";
const INPUT_EULA = "i-agree-to-the-eula";

/** Action output - resolved version */
export const OUTPUT_VERSION = "version";
const OUTPUT_VERSION = "version";
/** Action output - path containing the executable */
export const OUTPUT_PATH = "path";
const OUTPUT_PATH = "path";

/** The tool name */
export const TOOL_NAME = "flyway";
const TOOL_NAME = "flyway";
/** User agent to use for the HTTP downloads */
export const USER_AGENT = "setup-flyway-action";
const USER_AGENT = "setup-flyway-action";

/** Base URL for downloading Flyway */
export const BASE_URL = "https://download.red-gate.com/maven/release/com/redgate/flyway/flyway-commandline";
const BASE_URL = "https://download.red-gate.com/maven/release/com/redgate/flyway/flyway-commandline";
/** URL for the metadata file containing the available versions */
export const METADATA_URL = `${BASE_URL}/maven-metadata.xml`;
const METADATA_URL = `${BASE_URL}/maven-metadata.xml`;

export {
INPUT_PRODUCT_VERSION,
INPUT_EDITION,
INPUT_PRODUCT_ARCH,
INPUT_PRODUCT_PLATFORM,
INPUT_EMAIL,
INPUT_TOKEN,
INPUT_EULA,
OUTPUT_VERSION,
OUTPUT_PATH,
TOOL_NAME,
USER_AGENT,
BASE_URL,
METADATA_URL,
};
Loading