Skip to content

Commit

Permalink
first try at a weekly updater
Browse files Browse the repository at this point in the history
  • Loading branch information
h00die committed Dec 30, 2024
1 parent d86136c commit 340f783
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/weekly_updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Weekly Data Update

on:
schedule:
# Run once a week (e.g., every Monday at 01:00 UTC)
- cron: '0 1 * * 1'

jobs:
update-vulnerabilities:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: rapid7/metasploit-framework
#token: ${{ secrets.GITHUB_TOKEN }} # Use GitHub token for authentication
ref: main # Replace with the branch you want to work on, e.g., main or master

# Step 2: Set up Ruby environment
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0

# Step 3: Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12

# Step 4: Run the commands
- name: Run Ruby and Python scripts
run: |
ruby tools/dev/update_wordpress_vulnerabilities.rb
python3 tools/dev/update_joomla_components.py
ruby tools/dev/check_external_scripts.rb -u
# Step 5: Configure Git
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# Step 6: Add and commit changes
- name: Commit changes
run: |
git add .
git commit -m "Weekly Data update" || echo "No changes to commit"
# Step 7: Push changes to a new branch
- name: Push changes
run: |
git branch weekly-updates
git checkout weekly-updates
git push origin weekly-updates
# Step 8: Create a pull request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: weekly-updates
title: "Weekly Data Update"
body: |
This pull request was created automatically by a GitHub Action to update the vulnerability scripts.

0 comments on commit 340f783

Please sign in to comment.