diff --git a/.github/workflows/ref-archiver.yml b/.github/workflows/ref-archiver.yml index f4b0a1878..c65553149 100644 --- a/.github/workflows/ref-archiver.yml +++ b/.github/workflows/ref-archiver.yml @@ -25,9 +25,30 @@ jobs: run: | pip install PyYAML argparse requests python tests/reference-archiver.py - - name: Post Results - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 with: - filename: .github/archiver_output.md + reviewers: nasbench, frack113, phantinuss + delete-branch: true + commit-message: 'chore: archive new rule references and update cache file' + title: 'Archive New Rule References' + body: | + ### Summary of the Pull Request + + This PR update the cache file used to save already archived references with newly archived results + + ### Changelog + + chore: archive new rule references and update cache file + + ### Example Log Event + + N/A + + ### Fixed Issues + + N/A + + ### SigmaHQ Rule Creation Conventions + + - If your PR adds new rules, please consider following and applying these [conventions](https://github.com/SigmaHQ/sigma-specification/blob/main/sigmahq/sigmahq_conventions.md) diff --git a/tests/reference-archiver.py b/tests/reference-archiver.py index 8d77991e1..8bf0ffed0 100644 --- a/tests/reference-archiver.py +++ b/tests/reference-archiver.py @@ -8,6 +8,7 @@ import time import requests import yaml import os +from datetime import datetime WEB_ARCHIVE_SAVE_URL = "https://web.archive.org/save/" @@ -124,18 +125,10 @@ if __name__ == "__main__": f.write("\n") # Write markdown output to open the issue - with open(".github/archiver_output.md", "w") as f: - f.write("---\n") - f.write( - f"title: '\"Reference Archiver Results - {{ date | date('dddd, MMMM Do') }}\"'\n" - ) - f.write("assignees:\n") - f.write(" - nasbench\n") - f.write(" - frack113\n") - f.write(" - phantinuss\n") - f.write("---\n\n") + with open(".github/latest_archiver_output.md", "w") as f: + f.write(f"# Reference Archiver Results\n\n") + f.write(f"Last Execution: {datetime.today().strftime('%Y-%m-%d %H:%M:%S')}\n\n") f.write("### Archiver Script Results\n\n") - f.write("\n#### Newly Archived References\n\n") if newly_archived_references: for ref in newly_archived_references: