diff --git a/.github/workflows/update-repos.yaml b/.github/workflows/update-repos.yaml index 7ae22fa63..4b35ee08c 100644 --- a/.github/workflows/update-repos.yaml +++ b/.github/workflows/update-repos.yaml @@ -31,14 +31,14 @@ jobs: git config --global user.name 'hmcts-platform-operations' git config --global user.email 'github-platform-operations@HMCTS.NET' - - name: Pull latest changes with merge + - name: Create new branch run: | - git config pull.rebase false - git pull origin master --allow-unrelated-histories + git checkout master + git pull origin master + git checkout -b update-repo-list - name: Commit changes run: | - git checkout -b update-repo-list git add production-repos.json git commit -m 'Update repository list' @@ -55,9 +55,7 @@ jobs: sudo apt-get install gh -y - name: Authenticate GitHub CLI - run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" + run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - name: Create Pull Request - run: gh pr create --title "Automated Update Repository List" --body "This PR was created automatically to update the repository list." --head update-repo-list --base master - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr create --title "Automated Update Repository List" --body "This is an automated pull request to update the repository list." --head update-repo-list --base master