From 287b3835d86d96d79905281e38df6cef55f7cee4 Mon Sep 17 00:00:00 2001 From: Srgr0 <66754887+Srgr0@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:06:20 +0900 Subject: [PATCH 1/3] Update deploy-test-environment.yml --- .github/workflows/deploy-test-environment.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-test-environment.yml b/.github/workflows/deploy-test-environment.yml index 7f58654f3351..8ff1625f4800 100644 --- a/.github/workflows/deploy-test-environment.yml +++ b/.github/workflows/deploy-test-environment.yml @@ -24,6 +24,7 @@ jobs: if: github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/preview') outputs: is-allowed-user: ${{ steps.check-allowed-users.outputs.is-allowed-user }} + pr-repo: ${{ steps.get-ref.outputs.pr-repo }} pr-ref: ${{ steps.get-ref.outputs.pr-ref }} wait_time: ${{ steps.get-wait-time.outputs.wait_time }} steps: @@ -54,8 +55,12 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | PR_NUMBER=$(jq --raw-output .issue.number $GITHUB_EVENT_PATH) + PR_REPO_OWNER=$(gh pr view $PR_NUMBER --json headRepositoryOwner -q '.headRepositoryOwner.login') + PR_REPO_NAME=$(gh pr view $PR_NUMBER --json headRepository -q '.headRepository.name') + PR_REPO="$PR_REPO_OWNER/$PR_REPO_NAME" PR_REF=$(gh pr view $PR_NUMBER --json headRefName -q '.headRefName') - echo "pr-ref=$PR_REF" > $GITHUB_OUTPUT + echo "pr-repo=$PR_REPO" >> $GITHUB_OUTPUT + echo "pr-ref=$PR_REF" >> $GITHUB_OUTPUT - name: Extract wait time id: get-wait-time @@ -70,7 +75,7 @@ jobs: if: needs.get-pr-ref.outputs.is-allowed-user == 'true' uses: joinmisskey/misskey-tga/.github/workflows/deploy-test-environment.yml@main with: - repository: ${{ github.repository }} + repository: ${{ needs.get-pr-ref.outputs.pr-repo }} branch_or_hash: ${{ needs.get-pr-ref.outputs.pr-ref }} wait_time: ${{ needs.get-pr-ref.outputs.wait_time }} secrets: From 52847595f9ca9b07d3deb4da836d5abc1c694978 Mon Sep 17 00:00:00 2001 From: Srgr0 <66754887+Srgr0@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:30:23 +0900 Subject: [PATCH 2/3] Update deploy-test-environment.yml --- .github/workflows/deploy-test-environment.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/deploy-test-environment.yml b/.github/workflows/deploy-test-environment.yml index 8ff1625f4800..12efcefbeb2a 100644 --- a/.github/workflows/deploy-test-environment.yml +++ b/.github/workflows/deploy-test-environment.yml @@ -24,7 +24,6 @@ jobs: if: github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/preview') outputs: is-allowed-user: ${{ steps.check-allowed-users.outputs.is-allowed-user }} - pr-repo: ${{ steps.get-ref.outputs.pr-repo }} pr-ref: ${{ steps.get-ref.outputs.pr-ref }} wait_time: ${{ steps.get-wait-time.outputs.wait_time }} steps: @@ -51,15 +50,8 @@ jobs: - name: Get PR ref id: get-ref - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - PR_NUMBER=$(jq --raw-output .issue.number $GITHUB_EVENT_PATH) - PR_REPO_OWNER=$(gh pr view $PR_NUMBER --json headRepositoryOwner -q '.headRepositoryOwner.login') - PR_REPO_NAME=$(gh pr view $PR_NUMBER --json headRepository -q '.headRepository.name') - PR_REPO="$PR_REPO_OWNER/$PR_REPO_NAME" - PR_REF=$(gh pr view $PR_NUMBER --json headRefName -q '.headRefName') - echo "pr-repo=$PR_REPO" >> $GITHUB_OUTPUT + PR_REF="refs/pull/${{ github.event.issue.number }}/head" echo "pr-ref=$PR_REF" >> $GITHUB_OUTPUT - name: Extract wait time From 2fdb218f9abf9f2885848f7543d211a4acda993b Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Tue, 2 Apr 2024 22:07:58 +0900 Subject: [PATCH 3/3] use github.repository --- .github/workflows/deploy-test-environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-test-environment.yml b/.github/workflows/deploy-test-environment.yml index 12efcefbeb2a..c3fc10b681ab 100644 --- a/.github/workflows/deploy-test-environment.yml +++ b/.github/workflows/deploy-test-environment.yml @@ -67,7 +67,7 @@ jobs: if: needs.get-pr-ref.outputs.is-allowed-user == 'true' uses: joinmisskey/misskey-tga/.github/workflows/deploy-test-environment.yml@main with: - repository: ${{ needs.get-pr-ref.outputs.pr-repo }} + repository: ${{ github.repository }} branch_or_hash: ${{ needs.get-pr-ref.outputs.pr-ref }} wait_time: ${{ needs.get-pr-ref.outputs.wait_time }} secrets: