From ee7d94cae068965508f5306ad49419d613394e76 Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Tue, 30 Aug 2022 14:22:23 +0200 Subject: [PATCH] remove update submodules CI: fixes #1524 --- .github/workflows/update_submodules.yml | 105 ------------------------ 1 file changed, 105 deletions(-) delete mode 100644 .github/workflows/update_submodules.yml diff --git a/.github/workflows/update_submodules.yml b/.github/workflows/update_submodules.yml deleted file mode 100644 index 8a65977aa..000000000 --- a/.github/workflows/update_submodules.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: update submodules - -# This workflow will checkout the tracked branch of all submodules -# and will update the submodule pull the latest commit of that submodule branch - -# If the branch was not up to date this will then open a PR against the base branch -# in the repo this submodule belongs to. - -# ---- WARNING ---- -# Currently if the submodule is not tracking the default branch, -# this will workflow will fail. -# - -# requires sudmodules URL to be "https..." (no ssh) - -# requires submodule to be specified to follow a specific branch (stored in .gitmodules) -# -# clone them with: -# -# git submodule add -b branch_to_follow https://github.com/... submodule_path -# -# or specify it with: -# -# git config -f .gitmodules submodule.submodule_path.branch branch_to_follow -# - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - -on: - push: - branches: - - master - schedule: - - cron: '0 0 1 * *' - - # to trigger update manually from the Action tab in github - workflow_dispatch: - inputs: - log: - description: 'Log' - required: false - -defaults: - run: - shell: bash - -jobs: - update_submodules: - # only trigger update on upstream repo - if: github.repository_owner == 'bids-standard' - - runs-on: ubuntu-latest - - steps: - - name: Clone repo - uses: actions/checkout@v3 - with: - submodules: true - - # check out the correct branch for each submodule and pull them all - # https://stackoverflow.com/questions/5828324/update-git-submodule-to-latest-commit-on-origin - - name: Update submodules - run: | - set -e -u - start_dir=$PWD - submodules=$(git submodule | awk '{print $2}') - nb_submod=$(echo "${submodules}" | wc -l) - echo -e "\nUPDATING ${nb_submod} SUBMODULES" - echo -e "${submodules}" - paths=$(git config --file .gitmodules --name-only --get-regexp path) - branches=$(git config --file .gitmodules --name-only --get-regexp branch) - for i in $(seq 1 "${nb_submod}"); do - path=$(echo "${paths}" | awk -v i="${i}" '{print $i}') - path=$(git config --get --file .gitmodules "${path}") - branch=$(echo "${branches}" | awk -v i="${i}" '{print $i}') - branch=$(git config --get --file .gitmodules "${branch}") - echo -e "\nswitching submodule ${path} to ${branch}" - cd "${path}" || exit - git checkout "${branch}" - cd "${start_dir}" - done - git submodule update --remote --merge - - # if there have been changes, - # a PR is created using the checkout branch for this workflow - # https://github.com/peter-evans/create-pull-request - - name: Create Pull-Request - uses: peter-evans/create-pull-request@v4 - with: - commit-message: Update submodules - delete-branch: true - title: '[BOT] Updating git submodules' - body: 'Update git submodules via [CI](https://github.com/bids-standard/bids-validator/blob/master/.github/workflows/update_submodules.yml).'