Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions .github/workflows/preview-docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ jobs:
id: datetime
run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT

- name: Save PR metadata
run: |
mkdir -p /tmp/pr-metadata
echo "${{ github.event.pull_request.number }}" > /tmp/pr-metadata/pr-number.txt
echo "${{ github.event.pull_request.head.sha }}" > /tmp/pr-metadata/pr-sha.txt

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -64,21 +58,21 @@ jobs:
path: /tmp/fastgpt-docs-${{ steps.datetime.outputs.datetime }}.tar
retention-days: 1

- name: Upload PR metadata
uses: actions/upload-artifact@v4
with:
name: pr-metadata-docs-${{ steps.datetime.outputs.datetime }}
path: /tmp/pr-metadata/
retention-days: 1
outputs:
datetime: ${{ steps.datetime.outputs.datetime }}

call-push-workflow:
needs: build-docs-image
permissions:
contents: read
packages: write
attestations: write
id-token: write
Comment on lines +68 to +70
pull-requests: write
issues: write
uses: ./.github/workflows/preview-docs-push.yml
secrets: inherit
with:
pr_number: ${{ github.event.pull_request.number }}
pr_number: ${{ format('{0}', github.event.pull_request.number) }}
datetime: ${{ needs.build-docs-image.outputs.datetime }}
run_id: ${{ github.run_id }}

outputs:
datetime: ${{ steps.datetime.outputs.datetime }}
run_id: ${{ format('{0}', github.run_id) }}
8 changes: 0 additions & 8 deletions .github/workflows/preview-docs-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ jobs:
runs-on: ubuntu-24.04

steps:
- name: Download PR metadata
uses: actions/download-artifact@v4
with:
name: pr-metadata-docs-${{ inputs.datetime }}
path: /tmp/pr-metadata/
run-id: ${{ inputs.run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Read PR information
id: pr
run: |
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/preview-fastgpt-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ jobs:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0

- name: Save PR metadata
run: |
mkdir -p /tmp/pr-metadata
echo "${{ github.event.pull_request.number }}" > /tmp/pr-metadata/pr-number.txt
echo "${{ github.event.pull_request.head.sha }}" > /tmp/pr-metadata/pr-sha.txt

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
Expand Down Expand Up @@ -95,23 +89,23 @@ jobs:
path: /tmp/${{ steps.config.outputs.IMAGE_NAME }}-${{ github.sha }}.tar
retention-days: 1

- name: Upload PR metadata
uses: actions/upload-artifact@v4
with:
name: pr-metadata-${{ matrix.image }}-${{ github.sha }}
path: /tmp/pr-metadata/
retention-days: 1

call-push-workflow:
needs: build-preview-images
strategy:
matrix:
image: [fastgpt, sandbox, mcp_server]
fail-fast: false
permissions:
contents: read
packages: write
attestations: write
id-token: write
pull-requests: write
issues: write
Comment on lines +100 to +104
uses: ./.github/workflows/preview-fastgpt-push.yml
secrets: inherit
with:
pr_number: ${{ github.event.pull_request.number }}
pr_number: ${{ format('{0}', github.event.pull_request.number) }}
pr_sha: ${{ github.sha }}
run_id: ${{ github.run_id }}
run_id: ${{ format('{0}', github.run_id) }}
Comment on lines +108 to +110
image: ${{ matrix.image }}
15 changes: 8 additions & 7 deletions .github/workflows/preview-fastgpt-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ on:
required: true
type: string

permissions:
contents: read
packages: write
attestations: write
id-token: write
pull-requests: write
Comment on lines +21 to +24
issues: write

jobs:
push-preview-images:
permissions:
contents: read
packages: write
attestations: write
id-token: write
pull-requests: write
issues: write # Required for issue-comment (PR comments use Issues API)

runs-on: ubuntu-24.04

Expand Down
Loading