From da10da821d726ef740c81fa39e1008a10892a2f2 Mon Sep 17 00:00:00 2001 From: phlax Date: Sat, 3 Jun 2023 13:10:50 +0100 Subject: [PATCH] ci/sync: Use app to push changes (#629) Signed-off-by: Ryan Northey --- .github/workflows/envoy-sync.yaml | 12 ++++++++++-- ci/sync_envoy.sh | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/envoy-sync.yaml b/.github/workflows/envoy-sync.yaml index 8b04690a..3c94cd75 100644 --- a/.github/workflows/envoy-sync.yaml +++ b/.github/workflows/envoy-sync.yaml @@ -21,15 +21,21 @@ jobs: || github.actor == 'sync-envoy[bot]' }} steps: - # Checkout the repo + - id: appauth + uses: envoyproxy/toolshed/gh-actions/appauth@actions-v0 + with: + key: ${{ secrets.ENVOY_CI_UPDATE_BOT_KEY }} + app_id: ${{ secrets.ENVOY_CI_UPDATE_APP_ID }} + - name: 'Checkout Repository' uses: actions/checkout@v3 with: ref: main + token: ${{ steps.appauth.outputs.value }} fetch-depth: 0 # Checkout the Envoy repo - - name: 'Checkout Repository' + - name: 'Checkout Envoy Repository' uses: actions/checkout@v3 with: repository: envoyproxy/envoy @@ -41,3 +47,5 @@ jobs: - run: ci/sync_envoy.sh env: ENVOY_SRC_DIR: ../envoy + GITHUB_EMAIL: "135279899+update-envoy[bot]@users.noreply.github.com" + GITHUB_NAME: "update-envoy[bot]" diff --git a/ci/sync_envoy.sh b/ci/sync_envoy.sh index 080dbd32..a3ef6c2b 100755 --- a/ci/sync_envoy.sh +++ b/ci/sync_envoy.sh @@ -3,6 +3,9 @@ set -e API_MAIN_BRANCH="main" +COMMITTER_NAME="${GITHUB_NAME:-}" +COMMITTER_EMAIL="${GITHUB_EMAIL:-}" + if [[ -z "$ENVOY_SRC_DIR" ]]; then echo "ENVOY_SRC_DIR not set, it should point to a cloned Envoy repo" >&2 @@ -12,6 +15,9 @@ elif [[ ! -e "$ENVOY_SRC_DIR" ]]; then exit 1 fi +git config --global user.email "$COMMITTER_EMAIL" +git config --global user.name "$COMMITTER_NAME" + # Determine last envoyproxy/envoy SHA in envoyproxy/data-plane-api MIRROR_MSG="Mirrored from https://github.com/envoyproxy/envoy"