Skip to content

Commit

Permalink
Debugging release procedures
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemoret-nv committed Dec 4, 2023
1 parent a934028 commit d4b6ad4
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 20 deletions.
57 changes: 57 additions & 0 deletions .github/actions/configure-morpheus-bot/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Configure Morpheus Bot


inputs:
bot-app-id:
description: 'The app id of the bot'
required: true
type: string
bot-private-key:
description: 'The private key of the bot'
required: true
type: string
outputs:
token:
description: 'The token generated for the bot'
value: ${{steps.generate-token.outputs.token }}

runs:
using: "composite"
steps:
- name: Generate Token
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.ACTIONS_APP_ID }}
private-key: ${{ secrets.ACTIONS_APP_KEY }}
- name: Configure Git
run: |
git config -g user.name "morpheus-bot-test[bot]"
git config -g user.email "152534332+morpheus-bot-test[bot]@users.noreply.github.com"
echo "GITHUB_TOKEN=${{ steps.generate-token.outputs.token }}" >> "$GITHUB_ENV"
echo "Git config:"
git config -l --show-origin
echo "Github Auth Info:"
gh auth status
# - name: Checkout
# uses: actions/checkout@v3
# with:
# path: ${{ env.REPO_NAME }}
# ref: branch-${{ env.CURRENT_VERSION }}
# fetch-depth: 0 # Fetch all history for all tags and branches
# token: ${{ steps.generate-token.outputs.token }}
26 changes: 6 additions & 20 deletions .github/workflows/release_procedures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,38 +109,24 @@ jobs:
name: Create Next Release Branch
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: actions/create-github-app-token@v1
id: generate-token
- name: Configure Bot
id: configure-bot
uses: ./.github/actions/configure-morpheus-bot
with:
# required
app-id: ${{ secrets.ACTIONS_APP_ID }}
private-key: ${{ secrets.ACTIONS_APP_KEY }}
bot-app-id: ${{ secrets.ACTIONS_APP_ID }}
bot-private-key: ${{ secrets.ACTIONS_APP_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.REPO_NAME }}
ref: branch-${{ env.CURRENT_VERSION }}
fetch-depth: 0 # Fetch all history for all tags and branches
token: ${{ steps.generate-token.outputs.token }}
token: ${{ steps.configure-bot.outputs.token }}
- name: Auth info
run: |
cd ${REPO_NAME}
echo "Printing default auth"
gh auth status
echo "Printing auth for different token"
GITHUB_TOKEN=${{ steps.generate-token.outputs.token }} gh auth status
echo "GITHUB_TOKEN=${{ steps.generate-token.outputs.token }}" >> "$GITHUB_ENV"
# gh auth refresh
- name: Setup Git user
run: |
cd ${REPO_NAME}
git config user.name "morpheus-bot-test[bot]"
git config user.email "152534332+morpheus-bot-test[bot]@users.noreply.github.com"
# git config url.https://${{ steps.generate-token.outputs.token }}@github.com/.insteadOf https://github.com/
# gh auth setup-git
echo "Git config:"
git config -l --show-origin
- name: Create branch
run: |
cd ${REPO_NAME}
Expand Down

0 comments on commit d4b6ad4

Please sign in to comment.