-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1424 from blacklanternsecurity/dev
Dev --> Stable 2.0
- Loading branch information
Showing
348 changed files
with
32,768 additions
and
10,424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[flake8] | ||
select = F,E722 | ||
ignore = F403,F405,F541 | ||
per-file-ignores = | ||
*/__init__.py:F401,F403 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,8 @@ jobs: | |
needs: lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
# if one python version fails, let the others finish | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
|
@@ -76,14 +78,14 @@ jobs: | |
uses: EndBug/add-and-commit@v9 | ||
continue-on-error: true | ||
with: | ||
add: "*.md" | ||
add: '["*.md", "docs/data/chord_graph/*.json"]' | ||
author_name: "BBOT Docs Autopublish" | ||
author_email: [email protected] | ||
message: "Refresh module docs" | ||
publish_docs: | ||
needs: update_docs | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && (github.ref == 'refs/heads/dev') | ||
if: github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/dev') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
|
@@ -100,7 +102,28 @@ jobs: | |
run: | | ||
pip install poetry | ||
poetry install --only=docs | ||
- run: poetry run mkdocs gh-deploy --force | ||
- name: Configure Git | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git fetch origin gh-pages:refs/remotes/origin/gh-pages | ||
if git show-ref --verify --quiet refs/heads/gh-pages; then | ||
git branch -f gh-pages origin/gh-pages | ||
else | ||
git branch --track gh-pages origin/gh-pages | ||
fi | ||
- name: Generate docs (stable branch) | ||
if: github.ref == 'refs/heads/stable' | ||
run: | | ||
poetry run mike deploy Stable | ||
- name: Generate docs (dev branch) | ||
if: github.ref == 'refs/heads/dev' | ||
run: | | ||
poetry run mike deploy Dev | ||
- name: Publish docs | ||
run: | | ||
git switch gh-pages | ||
git push | ||
publish_code: | ||
needs: update_docs | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: Version Updater | ||
on: | ||
schedule: | ||
# Runs at 00:00 every day | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: # Adds the ability to manually trigger the workflow | ||
|
||
jobs: | ||
update-nuclei-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: dev | ||
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-latest-version | ||
run: | | ||
import os, requests | ||
response = requests.get('https://api.github.com/repos/projectdiscovery/nuclei/releases/latest') | ||
version = response.json()['tag_name'].lstrip('v') | ||
release_notes = response.json()['body'] | ||
os.system(f"echo 'latest_version={version}' >> $GITHUB_ENV") | ||
os.system(f"echo 'release_notes={release_notes}' >> $GITHUB_ENV") | ||
shell: python | ||
- name: Get current version | ||
id: get-current-version | ||
run: | | ||
version=$(grep -m 1 -oP '(?<=version": ")[^"]*' bbot/modules/deadly/nuclei.py) | ||
echo "current_version=$version" >> $GITHUB_ENV | ||
- name: Update version | ||
id: update-version | ||
if: env.latest_version != env.current_version | ||
run: "sed -i '0,/\"version\": \".*\",/ s/\"version\": \".*\",/\"version\": \"${{ env.latest_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 ${{ env.latest_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." | ||
Release notes: | ||
${{ env.release_notes }} | ||
branch: "update-nuclei" | ||
committer: GitHub <[email protected]> | ||
author: GitHub <[email protected]> | ||
assignees: "TheTechromancer" | ||
update-trufflehog-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: dev | ||
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-latest-version | ||
run: | | ||
import os, requests | ||
response = requests.get('https://api.github.com/repos/trufflesecurity/trufflehog/releases/latest') | ||
version = response.json()['tag_name'].lstrip('v') | ||
release_notes = response.json()['body'] | ||
os.system(f"echo 'latest_version={version}' >> $GITHUB_ENV") | ||
os.system(f"echo 'release_notes={release_notes}' >> $GITHUB_ENV") | ||
shell: python | ||
- name: Get current version | ||
id: get-current-version | ||
run: | | ||
version=$(grep -m 1 -oP '(?<=version": ")[^"]*' bbot/modules/trufflehog.py) | ||
echo "current_version=$version" >> $GITHUB_ENV | ||
- name: Update version | ||
id: update-version | ||
if: env.latest_version != env.current_version | ||
run: "sed -i '0,/\"version\": \".*\",/ s/\"version\": \".*\",/\"version\": \"${{ env.latest_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 ${{ env.latest_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. | ||
Release notes: | ||
${{ env.release_notes }} | ||
branch: "update-trufflehog" | ||
committer: GitHub <[email protected]> | ||
author: GitHub <[email protected]> | ||
assignees: "TheTechromancer" |
Oops, something went wrong.