Skip to content

Commit

Permalink
Merge pull request blacklanternsecurity#1427 from domwhewell-sage/ver…
Browse files Browse the repository at this point in the history
…sion-updater

Fix syntax error in workflow file
  • Loading branch information
TheTechromancer authored Jun 3, 2024
2 parents 85d5e92 + c7e559a commit 0ffa58a
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/version_updater.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
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
Expand All @@ -24,7 +27,9 @@ jobs:
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
Expand All @@ -34,16 +39,20 @@ jobs:
- 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
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."
branch: "dev"
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"
Expand All @@ -52,6 +61,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: dev
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -67,7 +77,9 @@ jobs:
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
Expand All @@ -77,16 +89,20 @@ jobs:
- 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
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."
branch: "dev"
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"

0 comments on commit 0ffa58a

Please sign in to comment.