diff --git a/.github/workflows/backup/update_json_date.yml.bak b/.github/workflows/backup/update_json_date.yml.bak index cb9bc855..236a14b8 100644 --- a/.github/workflows/backup/update_json_date.yml.bak +++ b/.github/workflows/backup/update_json_date.yml.bak @@ -21,6 +21,8 @@ jobs: with: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: community-scripts + repositories: ProxmoxVED - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/changelog-pr.yaml b/.github/workflows/changelog-pr.yaml index ca187dd5..300ce186 100644 --- a/.github/workflows/changelog-pr.yaml +++ b/.github/workflows/changelog-pr.yaml @@ -23,6 +23,8 @@ jobs: with: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: community-scripts + repositories: ProxmoxVED - name: Generate a token for PR approval and merge id: generate-token-merge @@ -30,6 +32,8 @@ jobs: with: app-id: ${{ secrets.APP_ID_APPROVE_AND_MERGE }} private-key: ${{ secrets.APP_KEY_APPROVE_AND_MERGE }} + owner: community-scripts + repositories: ProxmoxVED - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/delete_new_script.yaml b/.github/workflows/delete_new_script.yaml index 9d9f97d6..468573c1 100644 --- a/.github/workflows/delete_new_script.yaml +++ b/.github/workflows/delete_new_script.yaml @@ -20,6 +20,8 @@ jobs: with: app-id: ${{ secrets.APP_ID_APPROVE_AND_MERGE }} private-key: ${{ secrets.APP_KEY_APPROVE_AND_MERGE }} + owner: community-scripts + repositories: ProxmoxVED - name: Extract Issue Title (Lowercase & Underscores) id: extract_title diff --git a/.github/workflows/get-versions-from-gh.yaml b/.github/workflows/get-versions-from-gh.yaml index d3cd7e36..d45532e2 100644 --- a/.github/workflows/get-versions-from-gh.yaml +++ b/.github/workflows/get-versions-from-gh.yaml @@ -28,6 +28,8 @@ jobs: with: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: community-scripts + repositories: ProxmoxVED - name: Crawl from Github API env: diff --git a/.github/workflows/get-versions-from-newreleases.yaml b/.github/workflows/get-versions-from-newreleases.yaml index aabfae35..9d06d6c6 100644 --- a/.github/workflows/get-versions-from-newreleases.yaml +++ b/.github/workflows/get-versions-from-newreleases.yaml @@ -28,6 +28,8 @@ jobs: with: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: community-scripts + repositories: ProxmoxVED - name: Generate a token for PR approval and merge id: generate-token-merge @@ -35,6 +37,8 @@ jobs: with: app-id: ${{ secrets.APP_ID_APPROVE_AND_MERGE }} private-key: ${{ secrets.APP_KEY_APPROVE_AND_MERGE }} + owner: community-scripts + repositories: ProxmoxVED - name: Crawl from newreleases.io env: diff --git a/.github/workflows/live/changelog-pr.yml b/.github/workflows/live/changelog-pr.yml index dc5bcd3d..f3bb1cbd 100644 --- a/.github/workflows/live/changelog-pr.yml +++ b/.github/workflows/live/changelog-pr.yml @@ -22,6 +22,8 @@ jobs: with: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: community-scripts + repositories: ProxmoxVED - name: Checkout code uses: actions/checkout@v4 @@ -109,7 +111,7 @@ jobs: ); if (updateScriptsCategory) { - + const subCategory = updateScriptsCategory.subCategories.find(sub => sub.labels.some(label => prLabels.includes(label)) ); @@ -121,7 +123,7 @@ jobs: } } }); - + console.log(JSON.stringify(categorizedPRs, null, 2)); return categorizedPRs; @@ -147,30 +149,30 @@ jobs: const hasSubcategories = subCategories && subCategories.length > 0; const hasMainNotes = notes.length > 0; const hasSubNotes = hasSubcategories && subCategories.some(sub => sub.notes && sub.notes.length > 0); - - + + if (hasMainNotes || hasSubNotes) { newReleaseNotes += `### ${title}\n\n`; } - + if (hasMainNotes) { newReleaseNotes += ` ${notes.join("\n")}\n\n`; } if (hasSubcategories) { for (const { title: subTitle, notes: subNotes } of subCategories) { if (subNotes && subNotes.length > 0) { - newReleaseNotes += ` - #### ${subTitle}\n\n`; - newReleaseNotes += ` ${subNotes.join("\n ")}\n\n`; + newReleaseNotes += ` - #### ${subTitle}\n\n`; + newReleaseNotes += ` ${subNotes.join("\n ")}\n\n`; } } } - } - + } + const changelogContent = await fs.readFile(changelogPath, 'utf-8'); const changelogIncludesTodaysReleaseNotes = changelogContent.includes(`\n## ${today}`); - const regex = changelogIncludesTodaysReleaseNotes - ? new RegExp(`## ${today}.*(?=## ${latestDateInChangelog})`, "gs") + const regex = changelogIncludesTodaysReleaseNotes + ? new RegExp(`## ${today}.*(?=## ${latestDateInChangelog})`, "gs") : new RegExp(`(?=## ${latestDateInChangelog})`, "gs"); const newChangelogContent = changelogContent.replace(regex, newReleaseNotes); @@ -223,4 +225,4 @@ jobs: PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number') if [ -n "$PR_NUMBER" ]; then gh pr review $PR_NUMBER --approve - fi \ No newline at end of file + fi diff --git a/.github/workflows/live/update-json-date.yml b/.github/workflows/live/update-json-date.yml index 7e9c2497..861c4ee0 100644 --- a/.github/workflows/live/update-json-date.yml +++ b/.github/workflows/live/update-json-date.yml @@ -6,7 +6,7 @@ on: - main paths: - 'json/**.json' - workflow_dispatch: + workflow_dispatch: jobs: update-app-files: @@ -23,11 +23,13 @@ jobs: with: app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: community-scripts + repositories: ProxmoxVED - name: Generate dynamic branch name id: timestamp run: echo "BRANCH_NAME=pr-update-json-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV - + - name: Set up GH_TOKEN env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -102,8 +104,8 @@ jobs: - name: Commit and create PR if changes exist if: env.changed == 'true' run: | - - + + git commit -m "Update date in json" git checkout -b ${{ env.BRANCH_NAME }} git push origin ${{ env.BRANCH_NAME }}