Github Action to Update Nuclei Version #739
TheTechromancer
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Hi might I suggest some code here? wasn't sure if opening a PR was OK
name: Version Updater
on:
schedule:
- cron: '0 0 * * *'
jobs:
update-nuclei-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Get latest version
id: get-version
run: |
import requests
response = requests.get('https://api.github.com/repos/projectdiscovery/nuclei/releases/latest')
version = response.json()['tag_name'].lstrip('v')
print(f"::set-output name=version::{version}")
shell: python
- name: Update version
id: update-version
if: steps.get-version.outcome == 'success'
run: sed -i '0,/\"version\": \".*\",/ s/\"version\": \".*\",/\"version\": \"${{ steps.get-version.outputs.version }}\",/g' bbot/modules/deadly/nuclei.py
- name: Create pull request to update the version
if: steps.update-version.outcome == 'success'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update nuclei"
title: "Update nuclei to ${{ steps.get-version.outputs.version }}"
body: "This PR uses https://api.github.com/repos/projectdiscovery/nuclei/releases/latest to obtain the latest version of nuclei and update the version in bbot/modules/deadly/nuclei.py."
branch: "dev"
committer: GitHub <[email protected]>
author: GitHub <[email protected]>
assignees: "TheTechromancer"
update-trufflehog-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Get latest version
id: get-version
run: |
import requests
response = requests.get('https://api.github.com/repos/trufflesecurity/truffleHog/releases/latest')
version = response.json()['tag_name'].lstrip('v')
print(f"::set-output name=version::{version}")
shell: python
- name: Update version
id: update-version
if: steps.get-version.outcome == 'success'
run: sed -i '0,/\"version\": \".*\",/ s/\"version\": \".*\",/\"version\": \"${{ steps.get-version.outputs.version }}\",/g' bbot/modules/trufflehog.py
- name: Create pull request to update the version
if: steps.update-version.outcome == 'success'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update trufflehog"
title: "Update trufflehog to ${{ steps.get-version.outputs.version }}"
body: "This PR uses https://api.github.com/repos/trufflesecurity/truffleHog/releases/latest to obtain the latest version of trufflehog and update the version in bbot/modules/trufflehog.py."
branch: "dev"
committer: GitHub <[email protected]>
author: GitHub <[email protected]>
assignees: "TheTechromancer" |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be nice to have an action that monitors Nuclei's github for new releases, and when a new release is published, update the version in
nuclei.py
and create a PR. This will notify us when a new version is released and let us see whether the tests pass, etc. @liquidsec maybe we could work together on this one.Beta Was this translation helpful? Give feedback.
All reactions