mirror of
https://github.com/ManiMatter/decluttarr.git
synced 2026-04-19 22:54:21 +02:00
Cleanup of test
This commit is contained in:
28
.github/workflows/versionCleanup.js
vendored
28
.github/workflows/versionCleanup.js
vendored
@@ -1,28 +0,0 @@
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
// Function to execute shell commands
|
||||
function execute(command) {
|
||||
return execSync(command, { encoding: 'utf-8' });
|
||||
}
|
||||
|
||||
// Get all package versions from GitHub Packages registry
|
||||
const packageVersions = execute('npm show @ManiMatter/decluttarr versions --registry=https://npm.pkg.github.com');
|
||||
|
||||
// Get all tagged versions
|
||||
const taggedVersions = execute('git tag').split('\n');
|
||||
|
||||
// Get all referenced versions
|
||||
const referencedVersions = execute('npm view @ManiMatter/decluttarr dependencies --json --registry=https://npm.pkg.github.com');
|
||||
|
||||
// Logic to find untagged and unreferenced versions
|
||||
const untaggedAndUnreferencedVersions = packageVersions.filter(version => {
|
||||
// Check if version is not tagged
|
||||
const isUntagged = !taggedVersions.includes(version.trim());
|
||||
|
||||
// Check if version is not referenced by another package
|
||||
const isUnreferenced = !Object.values(referencedVersions).flat().includes(version.trim());
|
||||
|
||||
return isUntagged && isUnreferenced;
|
||||
});
|
||||
|
||||
console.log('Untagged and Unreferenced Versions:', untaggedAndUnreferencedVersions);
|
||||
22
.github/workflows/versionCleanup.yml
vendored
22
.github/workflows/versionCleanup.yml
vendored
@@ -1,22 +0,0 @@
|
||||
name: Check Untagged Versions
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Trigger manually
|
||||
|
||||
jobs:
|
||||
check_versions:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run the script
|
||||
run: node .github/workflows/versionCleanup.js
|
||||
Reference in New Issue
Block a user