xref: /aosp_15_r20/external/crosvm/infra/recipes/push_to_github.resources/push_to_github.sh (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1# Copyright 2022 The ChromiumOS Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# Pushes the current repo to github using the secret provided by Secret Manager.
6# See: https://console.cloud.google.com/security/secret-manager
7#
8# This script will only work if you have access to the above service via gcloud.
9set -e
10TOKEN=$(gcloud --project=crosvm-infra secrets versions access latest --secret="github-crosvm-bot")
11git push --force "https://crosvm-bot:${TOKEN}@github.com/google/crosvm.git" HEAD:main
12