From 593b13e61e6c57debed284bd9ea13b0f977acb62 Mon Sep 17 00:00:00 2001 From: Candy Tsai Date: Fri, 30 Aug 2024 12:00:47 +0800 Subject: [PATCH] Test publish plugin to Automattic/create-content-model-releases --- ...lugin-zip.yml => publish-latest-plugin-zip.yml} | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) rename .github/workflows/{publish-plugin-zip.yml => publish-latest-plugin-zip.yml} (68%) diff --git a/.github/workflows/publish-plugin-zip.yml b/.github/workflows/publish-latest-plugin-zip.yml similarity index 68% rename from .github/workflows/publish-plugin-zip.yml rename to .github/workflows/publish-latest-plugin-zip.yml index 0db1579..8e6f116 100644 --- a/.github/workflows/publish-plugin-zip.yml +++ b/.github/workflows/publish-latest-plugin-zip.yml @@ -1,4 +1,4 @@ -name: Publish plugin to Automattic/create-content-model-releases repository +name: Publish plugin to Automattic/create-content-model-releases latest on trunk merge on: pull_request: @@ -31,6 +31,17 @@ jobs: - name: Move plugin zip to output/ run: mv create-content-model.zip output/ + - name: Get user email + id: get_email + run: | + EMAIL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/users/${{ github.actor }} \ + | jq -r '.email // empty') + if [ -z "$EMAIL" ]; then + EMAIL="${{ github.actor }}@users.noreply.github.com" + fi + echo "email=$EMAIL" >> $GITHUB_OUTPUT + - name: Push zip to another repository uses: cpina/github-action-push-to-another-repository@main env: @@ -40,4 +51,5 @@ jobs: destination-github-username: "automattic" destination-repository-name: "create-content-model-releases" user-name: ${{ github.actor }} + user-email: ${{ steps.get_email.outputs.email }} target-branch: latest