[llvm] [workflows] Remove sync-release-repo.yml (PR #73682)

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 12:22:19 PST 2023


https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/73682

>From 288f125a4c7583514cf81ac82289ab0c7b737db6 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 28 Nov 2023 10:24:55 -0800
Subject: [PATCH 1/2] [workflows] Remove sync-release-repo.yml

This should not be needed now that the project uses PRs and the
OpenSSF Scorecard report as flagging this as insecure.
---
 .github/workflows/sync-release-repo.yml | 17 -----------------
 1 file changed, 17 deletions(-)
 delete mode 100644 .github/workflows/sync-release-repo.yml

diff --git a/.github/workflows/sync-release-repo.yml b/.github/workflows/sync-release-repo.yml
deleted file mode 100644
index c328a9133e179de..000000000000000
--- a/.github/workflows/sync-release-repo.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: Sync Release Repositories
-permissions:
-  contents: write
-on:
-  workflow_dispatch
-env:
-  RELEASE_BRANCH: release/17.x
-  GH_TOKEN: ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }}
-jobs:
-  sync:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Fetch LLVM sources
-        uses: actions/checkout at v4
-      - name: Run Sync Script
-        run: |
-          llvm/utils/git/sync-release-repo.sh

>From 3f188e28869d579b3aa7e93ed7f8e50365748d3b Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 28 Nov 2023 12:21:54 -0800
Subject: [PATCH 2/2] Remove bash script too

---
 llvm/utils/git/sync-release-repo.sh | 77 -----------------------------
 1 file changed, 77 deletions(-)
 delete mode 100755 llvm/utils/git/sync-release-repo.sh

diff --git a/llvm/utils/git/sync-release-repo.sh b/llvm/utils/git/sync-release-repo.sh
deleted file mode 100755
index 479407c65ed9bd2..000000000000000
--- a/llvm/utils/git/sync-release-repo.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/bash
-
-# This script will sync github.com/llvm/llvm-project with
-# github.com/llvm/llvm-project-release-prs and try to merge
-# the changes in the release branch.
-
-set -e
-set -x
-
-# We should always get the branch from the environment.
-# But otherwise just default to something. We can probably
-# have a better default here?
-RELEASE_BRANCH="${RELEASE_BRANCH:-release/16.x}"
-
-# We will add two remotes here:
-#  main - which will point to the main llvm-project repo
-#  release - which will point to the release-prs repo
-# The remotes will use random strings to avoid
-# collisions
-MAIN_REMOTE=$(uuidgen)
-RELEASE_REMOTE=$(uuidgen)
-CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
-# depth here must make sure to fetch enough history to make a merge,
-# it's an arbritary value at this point. Consider using --shallow-since=
-FETCH_OPTIONS="--prune --no-tags --progress --depth=100"
-
-git remote add $MAIN_REMOTE "https://github.com/llvm/llvm-project"
-git remote add $RELEASE_REMOTE "https://token:$GH_TOKEN@github.com/llvm/llvm-project-release-prs"
-
-# Make sure we are up to date on all our repos first
-git fetch $FETCH_OPTIONS $MAIN_REMOTE $RELEASE_BRANCH
-git fetch $FETCH_OPTIONS $RELEASE_REMOTE $RELEASE_BRANCH
-
-# Create our sync branch. Starting with the main
-# repo first since it's important to get those
-# changes
-MERGE_BRANCH=$(uuidgen)
-git switch -c $MERGE_BRANCH $MAIN_REMOTE/$RELEASE_BRANCH
-
-# Merge changes from the release repo
-git merge --ff-only $RELEASE_REMOTE/$RELEASE_BRANCH
-
-if ! git diff-index --quiet $MAIN_REMOTE/$RELEASE_BRANCH; then
-  echo "Changes in the release remote - pushing to main remote"
-  git push $MAIN_REMOTE $MERGE_BRANCH:$RELEASE_BRANCH
-fi
-
-# Before we merge back into the release repo
-# let's update to make sure nothing has been
-# pushed to either repo while we do this work.
-# Most of the time this won't do anything, and
-# the real solution would instead be to fetch
-# in a loop if pushing fails. But that's a very
-# tiny edge-case, so let's not complicate this.
-git fetch $FETCH_OPTIONS $MAIN_REMOTE $RELEASE_BRANCH
-git fetch $FETCH_OPTIONS $RELEASE_REMOTE $RELEASE_BRANCH
-
-# And merge all the new data to the current branch
-git merge --ff-only $MAIN_REMOTE/$RELEASE_BRANCH
-
-# If anything changed let's merge it
-if ! git diff-index --quiet $RELEASE_REMOTE/$RELEASE_BRANCH; then
-  echo "Changes in main - pushing to release"
-  # Remove the token stored by GH Actions, otherwise it
-  # won't use our own token in $GH_TOKEN
-  git config --unset-all http.https://github.com/.extraheader
-  git push $RELEASE_REMOTE $MERGE_BRANCH:$RELEASE_BRANCH
-fi
-
-# Cleanup - enable for debug
-if false; then
-  git remote remove $RELEASE_REMOTE
-  git remote remove $MAIN_REMOTE
-
-  git switch $CURRENT_BRANCH
-  git branch -D $MERGE_BRANCH
-fi



More information about the llvm-commits mailing list