Skip to content

This action helps you to validate XML syntax in a specified directory. And write back with formatted content. read file recursively with specified file extensions.

License

Notifications You must be signed in to change notification settings

anyone-developer/anyone-validate-xml

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

anyone-validate-xml

nightly-build release-build release-test FOSSA Status DependaBot version license Build Status XO code style Total alerts Language grade: JavaScript DeepScan grade Gitpod Ready-to-Code

This action helps you to validate XML syntax in a specified directory. And write back with formatted content. read file recursively with specified file extensions.

If you like my module, please buy me a coffee.

More and more tiny and useful GitHub action modules are on the way. Please donate to me. I accept a part-time job contract. if you need, please contact me: zhang_nan_163@163.com

Inputs

read-path

Required the path that you assign to read.

ignore-files

the files you want to ignore. split with a comma.

ignore-directories

the directories you want to ignore. split with a comma.

file-extension

file extension that you want to read. such as "config" or "xml". split with comma.

Outputs

output

the output of execution.

Other way usages

From NPM for programmatic use

  • create a 'demo' folder
  • npm init to create your nodejs package
  • copy 'sample_folder' to demo
  • npm install anyone-validate-xml to install module
  • create 'index.js' and copy code below:
import avx from '@anyone-developer/anyone-validate-xml';

avx(['.config', 'xml'], ['README.md'], ['c'], 'sample_folder').then(result => {
	const succeed = result.filter(i => i?.formatted);
	const failed = result.filter(i => i?.err);

	if (succeed?.length > 0) {
		console.info(`[${chalk.greenBright.bgYellowBright.bold('Succeed')}]`);
		succeed.forEach(v => {
			console.info(chalk.greenBright(`path: ${v.path}`));
		});
	}

	if (succeed?.length > 0 && failed?.length > 0) {
		console.log(`---------πŸ˜€${chalk.gray.bold('Happy Delimiter')}πŸ˜€---------`);
	}

	if (failed?.length > 0) {
		console.error(`[${chalk.redBright.bgRedBright.bold('Failed')}]`);
		failed.forEach(v => {
			console.error(chalk.greenBright(`path: ${v.path} msg: ${v.err?.message}`));
		});
	}
}).catch(error => console.error(error));
  • node index.js to run it

From NPM for using as a command-line app

  • npm install -g anyone-validate-xml to install gobally
  • anyone-validate-xml -r 'sample_folder' -f '.config,.xml' -I ".git" -i "README.md" to use your bash to execute it.

Example usage

uses: anyone-developer/anyone-validate-xml@main
with:
  file-extension: '.config,.xml'
  ignore-files: 'README.md'
  ignore-directories: '.git'
  read-path: 'sample_folder'

Fossa Report

FOSSA Status

Donation

PalPal: https://paypal.me/nzhang4

About

This action helps you to validate XML syntax in a specified directory. And write back with formatted content. read file recursively with specified file extensions.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages