diff --git a/.gitea/workflows/auto_pr.yaml b/.gitea/workflows/auto_pr.yaml index d14e2ac..4caa539 100644 --- a/.gitea/workflows/auto_pr.yaml +++ b/.gitea/workflows/auto_pr.yaml @@ -32,4 +32,19 @@ jobs: commit_message: Sort & Merge PIS Files commit_user_name: owlbot commit_user_email: owlbot@owlboard.info - commit_author: Robotic Owl \ No newline at end of file + commit_author: Robotic Owl + + - name: Create Pull Request + if: steps.commit.outputs.changes_detected == 'true' + uses: https://github.com/peter-evans/create-pull-request@v6 + with: + base_url: https://git.fjla.uk + token: ${{ secrets.OWLBOT_TOKEN }} + commit-branch: sort-merge-${{ github.run_id }} + base: main + title: 'Automated PIS Update: Robotic Owl' + delete-branch: true + body: | + This pull request was automatically generated by the Robotic Owl. + + It contains a consolidated and sorted PIS data file for review. Please inspect before merging. \ No newline at end of file diff --git a/scripts/merge-yaml.js b/scripts/merge-yaml.js index b16a9a4..827ea62 100644 --- a/scripts/merge-yaml.js +++ b/scripts/merge-yaml.js @@ -52,9 +52,9 @@ function sortAndMergeYAMLFiles() { console.error("Error writing codes.yaml", err) } - // Remove any files created by dgp2 + // Remove any new files files.forEach(file => { - if (file.startsWith('auto-')) { + if (file !== 'codes.yaml') { fs.unlinkSync(directoryPath + file); console.log(`Deleted file: ${file}`); }