crosvm/infra/recipes/push_to_github.resources/push_to_github.sh
Dennis Kempin 9a50dfbdcf infra: Fix push to github builder
Kokoro would maintain a local main branch in the local checkout,
so pushing --all will push the latest HEAD of main.

Luci will instead put us on a detached HEAD, with the local
main branch unmaintained. So we have been pushing the same old
version of crosvm.

Update the force push to submit HEAD to the remote main.

BUG=b:233913820
TEST=./recipes.py run push_to_github (requires authentication with
github to run)

Change-Id: I8282498382968768d66d9c807b9e86d191977beb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3681989
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-06-01 22:05:04 +00:00

11 lines
581 B
Bash

# Copyright 2022 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Pushes the current repo to github using the secret provided by Secret Manager.
# See: https://console.cloud.google.com/security/secret-manager
#
# This script will only work if you have access to the above service via gcloud.
set -e
TOKEN=$(gcloud --project=crosvm-infra secrets versions access 1 --secret="github-crosvm-bot")
git push --force "https://crosvm-bot:${TOKEN}@github.com/google/crosvm.git" HEAD:main