Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first try at a weekly updater #19776

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading