3030
3131      - name : Get latest dates in changelog 
3232        run : | 
33-           # Extrahiere die neuesten zwei Daten aus dem Changelog 
3433          DATES=$(grep -E '^## [0-9]{4}-[0-9]{2}-[0-9]{2}' CHANGELOG.md | head -n 2 | awk '{print $2}') 
35- 
3634          LATEST_DATE=$(echo "$DATES" | sed -n '1p') 
3735          SECOND_LATEST_DATE=$(echo "$DATES" | sed -n '2p') 
3836          TODAY=$(date -u +%Y-%m-%d) 
8684            }); 
8785
8886            if (!pulls || pulls.length === 0) { 
89-               console.log("⚠️ Keine gemergten PRs gefunden. Erzeuge  leeres Changelog."); 
87+               console.log("⚠️ Keine gemergten PRs gefunden. Setze  leeres Changelog."); 
9088              core.setOutput("result", "[]"); 
9189              return; 
9290            } 
@@ -144,7 +142,7 @@ jobs:
144142            }); 
145143
146144            core.setOutput("result", JSON.stringify(categorizedPRs.length ? categorizedPRs : [])); 
147-              
145+ 
148146       - name : Update CHANGELOG.md 
149147        uses : actions/github-script@v7 
150148        with :
@@ -155,7 +153,11 @@ jobs:
155153            const today = process.env.TODAY; 
156154            const latestDateInChangelog = process.env.LATEST_DATE; 
157155            const changelogPath = path.resolve('CHANGELOG.md'); 
158-             const categorizedPRs = JSON.parse(process.env.RESULT); 
156+             const result = `${{ steps.get-categorized-prs.outputs.result }}`.trim(); 
157+ 
158+             console.log("🔹 Ergebnis aus get-categorized-prs:", result); 
159+ 
160+             const categorizedPRs = result && result !== "undefined" ? JSON.parse(result) : []; 
159161
160162            let newReleaseNotes = `## ${today}\n\n### Changes\n\n`; 
161163            for (const { title, notes } of categorizedPRs) { 
@@ -167,7 +169,6 @@ jobs:
167169            const changelogContent = await fs.readFile(changelogPath, 'utf-8'); 
168170            const changelogIncludesTodaysReleaseNotes = changelogContent.includes(`\n## ${today}`); 
169171
170-             // Ersetze oder füge Release Notes ein 
171172            const regex = changelogIncludesTodaysReleaseNotes  
172173              ? new RegExp(`## ${today}.*(?=## ${latestDateInChangelog})`, "gs")  
173174              : new RegExp(`(?=## ${latestDateInChangelog})`, "gs"); 
0 commit comments