From 70e05ed51e38455c92deab0c1c8491444174870e Mon Sep 17 00:00:00 2001 From: zhy76 <958474674@qq.com> Date: Tue, 5 Sep 2023 02:27:33 +0000 Subject: [PATCH] feat: store files in fork repo Signed-off-by: zhy76 <958474674@qq.com> --- .github/workflows/test.yml | 15 +++++++++++---- README.md | 12 +++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cc1e37..bfeadb4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,25 +95,32 @@ jobs: with: name: ${{ steps.visualisation.outputs.visualisation-results-artifact }} path: images + # Checkout to fork repo + - name: Checkout + uses: actions/checkout@v3 + with: + repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }} # Store the latest summary report file - name: Store the latest summary report file uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + deploy_key: ${{ secrets.PERSONAL_TOKEN }} + external_repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }} publish_dir: ./summary_reports keep_files: true # Store the visualisation results - name: Store the visualisation results uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + deploy_key: ${{ secrets.PERSONAL_TOKEN }} + external_repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }} publish_dir: ./images keep_files: true # Comment the visualisation results on the PR - name: Comment on PR run: | - gh pr comment ${{ github.event.number }} -b"![system_graph](https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/${{ steps.visualisation.outputs.sys-visualisation-image }})" - gh pr comment ${{ github.event.number }} -b"![network_graph](https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/${{ steps.visualisation.outputs.network-visualisation-image }})" + gh pr comment ${{ github.event.number }} -b"![system_graph](https://raw.githubusercontent.com/${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }}/gh-pages/${{ steps.visualisation.outputs.sys-visualisation-image }})" + gh pr comment ${{ github.event.number }} -b"![network_graph](https://raw.githubusercontent.com/${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }}/gh-pages/${{ steps.visualisation.outputs.network-visualisation-image }})" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Delete the new app diff --git a/README.md b/README.md index 1713687..6887e90 100644 --- a/README.md +++ b/README.md @@ -157,25 +157,27 @@ jobs: with: name: ${{ steps.visualisation.outputs.visualisation-results-artifact }} path: images - # Store the latest summary report file + # Store the latest summary report file - name: Store the latest summary report file uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + deploy_key: ${{ secrets.PERSONAL_TOKEN }} + external_repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }} publish_dir: ./summary_reports keep_files: true # Store the visualisation results - name: Store the visualisation results uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + deploy_key: ${{ secrets.PERSONAL_TOKEN }} + external_repository: ${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }} publish_dir: ./images keep_files: true # Comment the visualisation results on the PR - name: Comment on PR run: | - gh pr comment ${{ github.event.number }} -b"![system_graph](https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/${{ steps.visualisation.outputs.sys-visualisation-image }})" - gh pr comment ${{ github.event.number }} -b"![network_graph](https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/${{ steps.visualisation.outputs.network-visualisation-image }})" + gh pr comment ${{ github.event.number }} -b"![system_graph](https://raw.githubusercontent.com/${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }}/gh-pages/${{ steps.visualisation.outputs.sys-visualisation-image }})" + gh pr comment ${{ github.event.number }} -b"![network_graph](https://raw.githubusercontent.com/${{ github.event.pull_request.user.login }}/${{ github.event.repository.full_name }}/gh-pages/${{ steps.visualisation.outputs.network-visualisation-image }})" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Delete the new app