Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
FonduemangVI authored Jul 3, 2024
2 parents e1cd881 + 08298b4 commit 950fbcd
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/configs/release-changelog-builder-action.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"categories": [
{
"title": "### Guide - Features",
"labels": ["type: enhancement", "type: guide request"],
"exhaustive": true
},
{
"title": "### Guide - Fixes",
"labels": ["type: bug"],
"exclude_labels": ["status: non issue"]
},
{
"title": "### Guide - Updates",
"labels": ["status: confirmed"]
},
{
"title": "### Radarr - Features",
"labels": ["area: radarr", "type: enhancement"],
"exhaustive": true
},
{
"title": "### Radarr - Fixes",
"labels": ["area: radarr", "type: bug"],
"exclude_labels": ["status: non issue"],
"exhaustive": true
},
{
"title": "### Radarr - Updates",
"labels": ["area: radarr"]
},
{
"title": "### Sonarr - Features",
"labels": ["area: sonarr", "type: enhancement"],
"exhaustive": true
},
{
"title": "### Sonarr - Fixes",
"labels": ["area: sonarr", "type: bug"],
"exclude_labels": ["status: non issue"],
"exhaustive": true
},
{
"title": "### Sonarr - Updates",
"labels": ["area: sonarr"]
},
{
"title": "### Others",
"labels": []
}
],
"ignore_labels": ["status: declined"],
"sort": {
"order": "ASC",
"on_property": "title"
},
"template": "${{CHANGELOG}}\n${{UNCATEGORIZED}}",
"pr_template": "- [${{TITLE}}](${{URL}})",
"empty_template": "- no changes",
"base_branches": [
"master"
]
}
61 changes: 61 additions & 0 deletions .github/scripts/update-contributors-backup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const axios = require('axios');
const fs = require('fs');

// Indentation function
function indentString(string, indentation) {
return string.split('\n').map(line => indentation + line).join('\n');
}

let contributors = '<table style="width: 100%;">\n';
let index = 0;
let page = 1;

function fetchPage() {
axios.get(`https://api.github.com/repos/FonduemangVI/Guides/contributors?per_page=100&page=${page}`)
.then((response) => {
if (response.data.length === 0) {
// No more contributors, write the file
if (index % 5 !== 0) {
contributors += '</tr>\n'; // Close the row if it's not already closed
}
contributors += '</table>\n';
contributors = indentString(contributors, '');

fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n<!-- readme: contributors -start -->\n${contributors}\n<!-- readme: contributors -end -->\n`);
return;
}

response.data.forEach((user) => {
// Exclude bots and actions-user
if (user.type === 'Bot' || user.login.toLowerCase().includes('bot') || user.login === 'actions-user' || user.login === 'mynameisbogdan') return;

if (index % 5 === 0) {
contributors += '<tr>';
}

const userHtml = `
<td align="center">
<img src="${user.avatar_url}&v=4" style="width: 50px; border-radius: 50%;" alt="${user.login}"/>
<br />
<b><a href="${user.html_url}">${user.login}</a></b>
</td>`;

contributors += indentString(userHtml, ' ');

if ((index + 1) % 5 === 0 || index === response.data.length - 1) {
contributors += '\n</tr>\n';
}

index++;
});

// Fetch the next page
page++;
fetchPage();
})
.catch((error) => {
console.error(`Could not fetch contributors: ${error}`);
});
}

fetchPage();
31 changes: 31 additions & 0 deletions .github/workflows/changelog-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Creation

on:
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Build the changelog
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
configuration: ".github/configs/release-changelog-builder-action.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Change the update file
- name: Modify updates.txt
uses: jaywcjlove/github-action-modify-file-content@main
with:
path: docs/updates.txt
body: "#{{date:YYYY-MM-DD HH:mm}}\n${{ steps.build_changelog.outputs.changelog }}"
openDelimiter: ""
closeDelimiter: ""
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: mkdocs build

deploy:
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref)
if: github.event.workflow_run.event == 'push' && contains(fromJson('["master", "main"]'), github.event.workflow_run.head_branch)
needs: build
name: Deploy docs
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions docs/stylesheets/neoteroi-mkdocs.css

Large diffs are not rendered by default.

0 comments on commit 950fbcd

Please sign in to comment.