diff --git a/.github/workflows/getdeps_linux.yml b/.github/workflows/getdeps_linux.yml index e02c52340..c8af0c818 100644 --- a/.github/workflows/getdeps_linux.yml +++ b/.github/workflows/getdeps_linux.yml @@ -10,11 +10,14 @@ on: branches: - main +permissions: + contents: read # to fetch code (actions/checkout) + jobs: build: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Fetch ninja run: python3 build/fbcode_builder/getdeps.py fetch --no-tests ninja - name: Fetch cmake diff --git a/.github/workflows/getdeps_mac.yml b/.github/workflows/getdeps_mac.yml index 296385ed8..034863e98 100644 --- a/.github/workflows/getdeps_mac.yml +++ b/.github/workflows/getdeps_mac.yml @@ -10,11 +10,14 @@ on: branches: - main +permissions: + contents: read # to fetch code (actions/checkout) + jobs: build: runs-on: macOS-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Fetch ninja run: python3 build/fbcode_builder/getdeps.py fetch --no-tests ninja - name: Fetch cmake diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index 4ab21537f..3b15bd342 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -944,6 +944,11 @@ class GenerateGitHubActionsCmd(ProjectCmdBase): def get_run_on(self, args): if args.run_on_all_branches: return self.RUN_ON_ALL + if args.cron: + return f""" + schedule: + - cron: '{args.cron}'""" + return f""" push: branches: @@ -1213,6 +1218,10 @@ jobs: parser.add_argument( "--ubuntu-version", default="20.04", help="Version of Ubuntu to use" ) + parser.add_argument( + "--cron", + help="Specify that the job runs on a cron schedule instead of on pushes", + ) parser.add_argument( "--main-branch", default="main",