From f099d017792d44610e527e75ecfe8b50b4407dfb Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 11 Mar 2025 15:58:23 +0100 Subject: [PATCH] Update move-to-main-repo.yaml --- .github/workflows/move-to-main-repo.yaml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/move-to-main-repo.yaml b/.github/workflows/move-to-main-repo.yaml index 61af163..5486ee9 100644 --- a/.github/workflows/move-to-main-repo.yaml +++ b/.github/workflows/move-to-main-repo.yaml @@ -27,6 +27,11 @@ jobs: repositories: | ProxmoxVE ProxmoxVED + + - name: Check GitHub authentication + run: gh auth status + env: + GH_TOKEN: ${{ secrets.GH_MERGE_PAT }} - name: Checkout ProxmoxVED (Source Repo) uses: actions/checkout@v4 @@ -41,21 +46,18 @@ jobs: GH_TOKEN: ${{ github.token }} run: | echo "Filtering Issues with Label MigrationTest" - raw_output=$(gh issue list --json title,labels) echo "$raw_output" filtered_issues=$(echo "$raw_output" | jq -r '.[] | select(.labels[]?.name == "MigrationTest") | .title') if [ -z "$filtered_issues" ]; then echo "No issues found with label 'MigrationTest'." + exit 1 else - echo "Found script names with 'MigrationTest' label:" - echo "$filtered_issues" - for script_name in $filtered_issues; do - echo "Processing: $script_name" - script_name_lowercase=$(echo "$script_name" | tr '[:upper:]' '[:lower:]') - echo "script_name=$script_name_lowercase" >> $GITHUB_ENV - done + script_name=$(echo "$filtered_issues" | head -n 1) # Nur das erste Issue nehmen + script_name_lowercase=$(echo "$script_name" | tr '[:upper:]' '[:lower:]' | tr -d ' ') + echo "Script Name: $script_name_lowercase" + echo "script_name=$script_name_lowercase" >> $GITHUB_ENV fi - name: Check if script files exist @@ -84,6 +86,12 @@ jobs: git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com' + - name: Prepare branch name + run: | + branch_name="add-script-${script_name//[^a-zA-Z0-9_-]/}" + echo "Using branch: $branch_name" + echo "branch_name=$branch_name" >> $GITHUB_ENV + - name: Prepare new branch for PR env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}