From cb0b44701f25080fed6d30c2be0b1980c9d23979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Wed, 22 Jan 2025 12:30:38 +0100 Subject: [PATCH] GH Action: don't push any updates to manifest-db repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is no longer relevant or needed. Signed-off-by: Tomáš Hozza --- .github/workflows/propagate_to_manifestdb.yml | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 .github/workflows/propagate_to_manifestdb.yml diff --git a/.github/workflows/propagate_to_manifestdb.yml b/.github/workflows/propagate_to_manifestdb.yml deleted file mode 100644 index b941b364..00000000 --- a/.github/workflows/propagate_to_manifestdb.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Update osbuild ref in manifest-db - -on: - push: - branches: - - main - -jobs: - propagate: - runs-on: ubuntu-latest - env: - SCHUTZBOT_GH: ${{ secrets.SCHUTZBOT_GITHUB_ACCESS_TOKEN }} - steps: - - name: Checkout OSBuild - uses: actions/checkout@v3 - with: - path: osbuild - fetch-depth: 0 - - - name: Update Manifest-db - run: | - # update only if manifest-db SHA was updated in the last commit - cd osbuild - ACTUAL_MDB_SHA=$(git show HEAD:Schutzfile | jq -r '.global.dependencies."manifest-db".commit') - PREVIOUS_MDB_SHA=$(git show HEAD^:Schutzfile | jq -r '.global.dependencies."manifest-db".commit') - if [[ $ACTUAL_MDB_SHA == $PREVIOUS_MDB_SHA ]] ; then - echo "The manifest-db SHA was not updated in the last commit, ignoring the dependency update" - exit 0 - fi - echo "updating the dependency in manifest-db" - OSBUILD_HEAD="${{ github.sha }}" - echo "Latest OSBuild SHA: $OSBUILD_HEAD" - - # Clone manifest-db - cd .. - git clone https://github.com/osbuild/manifest-db.git - - # Load the previous osbuild REF from manifest-db's Schutzfile and - # Generate the commit list between the two osbuild revisions for the - # PR - cd manifest-db - OLD_REF=$(jq -r '.global.dependencies.osbuild.commit' Schutzfile) - cd ../osbuild - COMMIT_LIST=$(git log --oneline $OLD_REF..$OSBUILD_HEAD | sed 's/.*/- https:\/\/github.com\/osbuild\/osbuild\/commit\/&/') - - # Update the manifest-db's dependency to the newest OSBuild - # - # Login as Schutzbot - cd ../manifest-db - echo "${SCHUTZBOT_GH}" | gh auth login --with-token - git config --local user.name "SchutzBot" - git config --local user.email "imagebuilder-bots+schutzbot@redhat.com" - - # Create a branch for the PR - now=$(date '+%Y-%m-%d-%H%M%S') - BRANCH_NAME="osbuild-update-$now" - git checkout -b $BRANCH_NAME - - # change the value for the commit head in the schutzfile - jq --arg variable "$OSBUILD_HEAD" '.global.dependencies.osbuild.commit=$variable' Schutzfile > Schutzfile.tmp && mv Schutzfile.tmp Schutzfile - - # create the PR - PR_BODY="$(cat <<-END - This PR updates the osbuild ref dependency for manifest-db. Between the - last time it was updated, and this new reference commit, these are the changes: - - $COMMIT_LIST - END - )" - git remote add upstream https://schutzbot:"$SCHUTZBOT_GH"@github.com/schutzbot/manifest-db.git - git add -A && \ - git commit -m "schutzfile: update osbuild ref $(date '+%Y-%m-%d')" && \ - git push upstream "$BRANCH_NAME:$BRANCH_NAME" && \ - gh pr create \ - --title "schutzfile: update osbuild ref $(date '+%Y-%m-%d')" \ - --body "$PR_BODY" \ - --repo "osbuild/manifest-db" \ - -r lavocatt