admin管理员组

文章数量:1123766

I am using Flutter web with Firebase and want to post preview url as a comment on Pull Request. I tried several ways and finally when I hard code the pr number its working. This is how I have it now.

name: Deploy to Firebase Hosting on PR

on: pull_request

permissions:
  checks: write
  contents: read
  pull-requests: write

jobs:
  build_and_preview:
    if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      # Step to install Flutter
      - name: Install Flutter
        run: |
          git clone .git -b stable
          echo "$GITHUB_WORKSPACE/flutter/bin" >> $GITHUB_PATH

      # Run the build command
      - name: Build the app
        run: npm run build

      # Deploy to Firebase Hosting
      - name: Deploy to Firebase Hosting
        uses: FirebaseExtended/[email protected]
        with:
          repoToken: ${{ secrets.GITHUB_TOKEN }}
          firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_XXXXXX }}
          projectId: XXXXX-dev

      # Comment on PR with Preview Link
      - name: Comment on PR with Preview Link
        run: |
          curl -X POST \
            -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
            -d '{"body": "Preview link: ;}' \
            "/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"

How can I create a dynamic link with the PR number. Thanks for the advice. How can I create a dynamic link with the PR number. Thanks for the advice. How can I create a dynamic link with the PR number. Thanks for the advice.

本文标签: flutterWhy am I unable to post preview url as comment on Github Pull requestStack Overflow