Skip to content

Commit

Permalink
Add scheduled scanning to the templates for GitLab and GitHub (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
omerzi authored Apr 19, 2023
1 parent e0ab27d commit 88c7470
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/frogbot-scan-and-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- "dev"
schedule:
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down
1 change: 1 addition & 0 deletions action/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function main() {
yield utils_1.Utils.execScanPullRequest();
break;
case "push":
case "schedule":
yield utils_1.Utils.execCreateFixPullRequests();
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion action/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions action/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ async function main() {
await Utils.execScanPullRequest();
break;
case "push":
case "schedule":
await Utils.execCreateFixPullRequests();
break;
default:
Expand Down
7 changes: 3 additions & 4 deletions docs/install-gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ frogbot-scan:
variables:
FROGBOT_CMD: "scan-pull-request"
JF_GIT_BASE_BRANCH: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
# Creating fix pull requests will be triggered by any push to the default branch.
# You can change it to any other branch you want, for example:
# if: $CI_COMMIT_BRANCH == "dev"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Repository scanning is triggered by any push to the default branch.
# If you'd like a different branch to be scanned, replace $CI_DEFAULT_BRANCH in the line below with the name of branch, wrapped with quotes (").
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_PIPELINE_SOURCE == "schedule"
variables:
FROGBOT_CMD: "create-fix-pull-requests"
JF_GIT_BASE_BRANCH: $CI_COMMIT_BRANCH
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: "Frogbot Scan and Fix"
on:
push:
# Creating fix pull requests will be triggered by any push to one of the these branches.
# Creating fix pull requests will be triggered by any push to one of these branches.
# You can add or replace to any branch you want to open fix pull requests for.
branches:
- "main"
- "master"
schedule:
# The job will run once a day at 00:00 GMT.
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: "Frogbot Scan and Fix"
on:
push:
# Creating fix pull requests will be triggered by any push to one of the these branches.
# Creating fix pull requests will be triggered by any push to one of these branches.
# You can add or replace to any branch you want to open fix pull requests for.
branches:
- "main"
- "master"
schedule:
# The job will run once a day at 00:00 GMT.
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: "Frogbot Scan and Fix"
on:
push:
# Creating fix pull requests will be triggered by any push to one of the these branches.
# Creating fix pull requests will be triggered by any push to one of these branches.
# You can add or replace to any branch you want to open fix pull requests for.
branches:
- "main"
- "master"
schedule:
# The job will run once a day at 00:00 GMT.
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: "Frogbot Scan and Fix"
on:
push:
# Creating fix pull requests will be triggered by any push to one of the these branches.
# Creating fix pull requests will be triggered by any push to one of these branches.
# You can add or replace to any branch you want to open fix pull requests for.
branches:
- "main"
- "master"
schedule:
# The job will run once a day at 00:00 GMT.
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: "Frogbot Scan and Fix"
on:
push:
# Creating fix pull requests will be triggered by any push to one of the these branches.
# Creating fix pull requests will be triggered by any push to one of these branches.
# You can add or replace to any branch you want to open fix pull requests for.
branches:
- "main"
- "master"
schedule:
# The job will run once a day at 00:00 GMT.
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: "Frogbot Scan and Fix"
on:
push:
# Creating fix pull requests will be triggered by any push to one of the these branches.
# Creating fix pull requests will be triggered by any push to one of these branches.
# You can add or replace to any branch you want to open fix pull requests for.
branches:
- "main"
- "master"
schedule:
# The job will run once a day at 00:00 GMT.
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: "Frogbot Scan and Fix"
on:
push:
# Creating fix pull requests will be triggered by any push to one of the these branches.
# Creating fix pull requests will be triggered by any push to one of these branches.
# You can add or replace to any branch you want to open fix pull requests for.
branches:
- "main"
- "master"
schedule:
# The job will run once a day at 00:00 GMT.
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down
5 changes: 3 additions & 2 deletions starter-workflows/code-scanning/frogbot-scan-and-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ name: "Frogbot Scan and Fix"
on:
push:
branches: [ $default-branch ]
schedule:
# The job will run once a day at 00:00 GMT.
- cron: "0 0 * * *"
permissions:
contents: write
pull-requests: write
Expand Down Expand Up @@ -55,8 +58,6 @@ jobs:
# The 'frogbot' executable and other tools it needs will be downloaded through this repository.
# JF_RELEASES_REPO: ""



##########################################################################
## If you project uses a 'frogbot-config.yml' file, you can define ##
## the following variables inside the file, instead of here. ##
Expand Down

0 comments on commit 88c7470

Please sign in to comment.