Skip to content

Commit

Permalink
Remove PR checkout code
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jun 28, 2024
1 parent f93b069 commit 8593f04
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/sync-backport-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: Check Core Backport Changlog
name: Sync Core Backport Changelog Issue

on:
push:
branches:
- try/sync-backport-changelog

jobs:
sync-backport-changelog:
name: Sync Core backport changelogs to issues
name: Sync Core Backport Changelog Issue
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Sync Issues

- name: Sync Issue
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
Expand Down Expand Up @@ -42,18 +41,20 @@ jobs:
console.log(`Latest version: ${version}`);
const { execSync } = require('child_process');
const processedChangelog = execSync(`awk '/./ {print ($0 ~ /^[-*]/ ? " " : "- ") $0}' backport-changelog/${version}/*.md`).toString();
const processedChangelog = execSync(`awk '/./ {print ($0 ~ /^[-*]/ ? " " : "- ") $0}' backport-changelog/${version}/*.md`).toString().trim();
const prependChangelog = `This description is continuously generated by a script. Please do not edit, leave comments instead.\n\n`;
const body = prependChangelog + processedChangelog;
if (latestIssue.body.trim() !== body) {
if (latestIssue.body.trim() !== body.trim()) {
console.log(processedChangelog);
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: latestIssue.number,
body
});
console.log('Issue description updated successfully.');
} else {
console.log('Issue description is already up to date.');
}

0 comments on commit 8593f04

Please sign in to comment.