From 46d370c5f9642c155f67b837ab39449a258b574b Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 19 Sep 2023 12:15:53 -0300 Subject: [PATCH 1/6] update create pr action version --- .github/workflows/update_knapsack_report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index ef8b4f45..b9f895d2 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -3,7 +3,7 @@ name: Update Knapsack Report # This workflow should be scheduled at certain intervals on: schedule: - - cron: '0 5 31 2 *' + - cron: '*/15 * * * *' # The above cron does not run. Replace with the wanted periodicity. # For example, the following configuration would schedule it every 3 months # - cron: '0 0 1 */3 *' @@ -50,7 +50,7 @@ jobs: - name: Push changes run: git push origin HEAD:update-knapsack-report - name: Initialize Pull Request - uses: rootstrap/create-pull-request@v3 + uses: rootstrap/create-pull-request@v5 with: pull_request_token: ${{ secrets.GITHUB_TOKEN }} head: update-knapsack-report From e7cf04dc3a9c9084f2bbf847a6ffa9d87445cf87 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 19 Sep 2023 15:38:31 -0300 Subject: [PATCH 2/6] update ruby step --- .github/workflows/update_knapsack_report.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index b9f895d2..a2da4484 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -3,7 +3,7 @@ name: Update Knapsack Report # This workflow should be scheduled at certain intervals on: schedule: - - cron: '*/15 * * * *' + - cron: '*/5 * * * *' # The above cron does not run. Replace with the wanted periodicity. # For example, the following configuration would schedule it every 3 months # - cron: '0 0 1 */3 *' @@ -29,14 +29,14 @@ jobs: env: RAILS_ENV: test + github_token: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - - name: Set up Ruby 3.1 - uses: actions/setup-ruby@v1 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 with: - ruby-version: 3.1 - github_token: ${{ secrets.GITHUB_TOKEN }} + bundler-cache: true - name: Setup Database run: bundle exec rails db:create db:migrate - name: Update Knapsack Report From 57484e1c9ace80a3e271dc9fc9dd895ebd78cbfd Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 19 Sep 2023 16:30:15 -0300 Subject: [PATCH 3/6] updates --- .github/workflows/update_knapsack_report.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index a2da4484..17727f03 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -3,7 +3,7 @@ name: Update Knapsack Report # This workflow should be scheduled at certain intervals on: schedule: - - cron: '*/5 * * * *' + - cron: '0 5 31 2 *' # The above cron does not run. Replace with the wanted periodicity. # For example, the following configuration would schedule it every 3 months # - cron: '0 0 1 */3 *' @@ -52,8 +52,8 @@ jobs: - name: Initialize Pull Request uses: rootstrap/create-pull-request@v5 with: - pull_request_token: ${{ secrets.GITHUB_TOKEN }} - head: update-knapsack-report + token: ${{ secrets.GITHUB_TOKEN }} + branch: update-knapsack-report base: main title: 'Update Knapsack report' maintainer_can_modify: true From f0134813469cfc1eb88ac019c4f3bffe55c709bd Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 19 Sep 2023 16:45:28 -0300 Subject: [PATCH 4/6] update docs --- docs/ci.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/ci.md b/docs/ci.md index d2960f44..2b174fb6 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -37,6 +37,10 @@ It is now scheduled for February 31 so will never run. - cron: '0 5 31 2 *' # The above cron does not run. Replace with the wanted periodicity. ``` + +If the branch exists or the PR is already created the workflow will fail. +In your repository settings -> actions -> general -> Workflow permissions we need to allow read / write permissions and mark the option allow Github action to create PR, other case the workflow will fail. + ## Coverage When splitting tests in different nodes, each report covers only a part of the code files being tested. For this reason a job in the CI is added to sums coverages from all nodes to be used by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. From 0607bc967e51c93ca020c6d151d0fedd69e3d8f2 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 19 Sep 2023 17:25:17 -0300 Subject: [PATCH 5/6] remove unused var --- .github/workflows/update_knapsack_report.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index 17727f03..f9ed5808 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -29,7 +29,6 @@ jobs: env: RAILS_ENV: test - github_token: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 From 8f4490f8271701b9a5920e592192822964c7f5b1 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Wed, 20 Sep 2023 11:48:23 -0300 Subject: [PATCH 6/6] disable scheduled cron. Add run manually --- .github/workflows/update_knapsack_report.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index f9ed5808..f8cfc570 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -1,12 +1,11 @@ name: Update Knapsack Report -# This workflow should be scheduled at certain intervals on: - schedule: - - cron: '0 5 31 2 *' -# The above cron does not run. Replace with the wanted periodicity. -# For example, the following configuration would schedule it every 3 months + workflow_dispatch: +# This workflow should be scheduled at certain intervals +# schedule: # - cron: '0 0 1 */3 *' +# The above cron would schedule it every 3 months. Replace with the wanted periodicity. jobs: build: