From 2b2d92da19146bd766546256206dc498a9a6c18e Mon Sep 17 00:00:00 2001 From: Andy Fragen Date: Thu, 9 Jan 2025 12:13:41 -0800 Subject: [PATCH] Update GitHub workflow for POT creation using native functions and not a GitHub Action (#259) Signed-off-by: Andy Fragen Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com> --- .github/workflows/generate-pot-pr.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/generate-pot-pr.yml b/.github/workflows/generate-pot-pr.yml index 04077e3..8b5b1d4 100644 --- a/.github/workflows/generate-pot-pr.yml +++ b/.github/workflows/generate-pot-pr.yml @@ -28,8 +28,8 @@ jobs: - name: Configure git user run: | - git config --global user.email "andy@thefragens.com" - git config --global user.name "Andy Fragen" + git config user.name ${{ github.actor }} + git config user.email ${{ github.actor }}@users.noreply.github.com - name: Check if remote branch exists run: echo "REMOTE_BRANCH_EXISTS=$([[ -z $(git ls-remote --heads origin generate-pot) ]] && echo "0" || echo "1")" >> $GITHUB_ENV @@ -62,10 +62,7 @@ jobs: - name: Create pull request if: env.CHANGES_DETECTED == 1 - uses: repo-sync/pull-request@v2 - with: - source_branch: generate-pot - destination_branch: ${{ github.event.repository.default_branch }} - github_token: ${{ secrets.GITHUB_TOKEN }} - pr_title: Generate POT - pr_body: "This is an automated pull-request" + run: gh pr create --base ${BRANCH_NAME} --head generate-pot --title "Generate POT - $(date +'%Y-%m-%d')" --body "Automated PR" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }}