Skip to content
Open
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
16 changes: 15 additions & 1 deletion .github/workflows/cleaner.js → .github/workflows/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,25 @@ async function validate(type) {
console.log(`Repo: ${owner}/${repo}, Stars: ${stars}, Archived: ${isArchived}, Last Commit Date: ${lastCommitDate}`);
const newOwner = entry.owner.login;
const newRepo = entry.name;

// Update link if repository has been renamed
if (owner !== newOwner || repo !== newRepo) {
console.log(`Repo: ${owner}/${repo} has been renamed to ${newOwner}/${newRepo}`);
content.link = `https://github.com/${newOwner}/${newRepo}`;
fs.writeFileSync(file, yaml.dump(content));
}

// Initialize repository object if it doesn't exist
if (!content.repository) {
content.repository = {};
}

// Update repository information
content.repository = {
is_archived: isArchived,
stars: stars,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I don't think star counts are particularly reliable and don't see the need to display them on the website. However, this might be useful for others, so I've added it.

last_commit_date: lastCommitDate
};
fs.writeFileSync(file, yaml.dump(content));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Managing an update flag adds complexity to the code, so I changed it to always write. Given the number of files, I don't think this will have a significant performance impact.

} else {
console.log(`Repo: ${owner}/${repo} does not exist or is private.`);
console.log(`Remove: ${file}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Cleaner
name: Updater

on:
schedule:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install Dependencies
run: npm install
- name: Cleanup
run: node .github/workflows/cleaner.js
run: node .github/workflows/updater.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Config
Expand Down