diff --git a/.github/mra_sync.latest_commit.txt b/.github/mra_sync.latest_commit.txt deleted file mode 100644 index b11fb12d7..000000000 --- a/.github/mra_sync.latest_commit.txt +++ /dev/null @@ -1 +0,0 @@ -88bae7ca2bbd2a68da10761956a617ad960f9c02 diff --git a/.github/mra_sync.sh b/.github/mra_sync.sh deleted file mode 100755 index afb665921..000000000 --- a/.github/mra_sync.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -LATEST_COMMIT_FILE=".github/mra_sync.latest_commit.txt" - -echo "Checking for changed MRAs..." -echo - -git fetch origin --unshallow 2> /dev/null || true -git checkout -f master - -LATEST_COMMIT=$(git log -n 1 --pretty=format:"%H") -PREVIOUS_COMMIT="$(cat ${LATEST_COMMIT_FILE})" - -echo -echo "Latest commit: ${LATEST_COMMIT}" -echo "Previous commit: ${PREVIOUS_COMMIT}" -echo - -TMP=$(mktemp) - -if ! git diff --name-only ${LATEST_COMMIT}..${PREVIOUS_COMMIT} | grep -i '.mra$' | grep -iv '/_alternatives/' > ${TMP} ; then - PREVIOUS_COMMIT="$(git rev-list --max-parents=0 HEAD)" - git diff --name-only ${LATEST_COMMIT}..${PREVIOUS_COMMIT} | grep -i '.mra$' | grep -iv '/_alternatives/' > ${TMP} -fi - -MRA_QTY=$(cat ${TMP} | wc -l) - -if [ ${MRA_QTY} -ge 1 ] ; then - echo "Found some MRAs that have been changed:" - echo - cat ${TMP} - echo - echo "Total: ${MRA_QTY}" - echo - echo "Checking if sync is needed." - echo - - while IFS="" read -r mra || [ -n "${mra}" ] ; do - if [ ! -f "${mra}" ] ; then - echo "${mra} is not a valid file." - continue - fi - MRA_NAME="$(basename "${mra}")" - find . -type f -name "${MRA_NAME}" -print0 | while IFS= read -r -d '' copy; do - if [[ "$(realpath "${copy}")" == "$(realpath "${mra}")" ]] || diff -q "${copy}" "${mra}" > /dev/null ; then - continue - fi - echo cp "${mra}" "${copy}" - cp "${mra}" "${copy}" - git add "${copy}" - done - done < "${TMP}" - - if git diff --staged --quiet ; then - echo - echo "No need to sync anything." - else - export GIT_MERGE_AUTOEDIT=no - git config --global user.email "theypsilon@gmail.com" - git config --global user.name "The CI/CD Bot" - - echo - echo "Pushing changes to origin:" - echo "${LATEST_COMMIT}" > "${LATEST_COMMIT_FILE}" - git add "${LATEST_COMMIT_FILE}" - git commit -m "BOT: Syncing MRAs." -m "Because of detected changes between ${LATEST_COMMIT}..${PREVIOUS_COMMIT}." - git push origin master - fi -else - echo "Found none." -fi - -rm ${TMP} \ No newline at end of file diff --git a/.github/workflows/mra_tasks.yml b/.github/workflows/mra_tasks.yml deleted file mode 100755 index c88cf6178..000000000 --- a/.github/workflows/mra_tasks.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: MRA Tasks - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Sync MRAs - run: ./.github/mra_sync.sh