diff --git a/.github/workflows/artifact-links.yml b/.github/workflows/artifact-links.yml deleted file mode 100644 index 60b05445e1..0000000000 --- a/.github/workflows/artifact-links.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Artifact links comments creator -on: - workflow_run: - workflows: ["PR"] - types: [completed] - -jobs: - artifacts-url-comments: - name: Add artifact links to PR and issues - runs-on: ubuntu-latest - steps: - - name: Add artifact links to PR and issues - uses: tonyhallett/artifacts-url-comments@v1.1.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - prefix: "Do you want to test this code? Here you have an automated build:" - suffix: "WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!" - format: name - addTo: pull diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 428cff3119..c3da10681d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -105,6 +105,12 @@ jobs: name: dist-files path: src/dist + - name: Download APK artifact + uses: actions/download-artifact@v5 + with: + name: betaflight-configurator-apk + path: apk/ + - name: Set short git commit SHA id: vars run: | @@ -133,9 +139,17 @@ jobs: - name: Add deployment comment if: github.event_name == 'pull_request_target' || github.event_name == 'pull_request' - uses: thollander/actions-comment-pull-request@v3 + uses: actions/github-script@v7 with: - message: | - Preview URL: ${{ steps.deploy.outputs.pages-deployment-alias-url }} - comment-tag: 'Preview URL' - mode: recreate + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const previewUrl = '${{ steps.deploy.outputs.pages-deployment-alias-url }}'; + const apkUrl = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; + const message = `Preview URL: ${previewUrl}\nAndroid APK: [Download from artifacts](${apkUrl})`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: message + }); diff --git a/.github/workflows/hide-artifact-links.yml b/.github/workflows/hide-artifact-links.yml index 44543917a3..d13f935bfa 100644 --- a/.github/workflows/hide-artifact-links.yml +++ b/.github/workflows/hide-artifact-links.yml @@ -13,5 +13,4 @@ jobs: uses: int128/hide-comment-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - starts-with: "Do you want to test this code? Here you have an automated build:" - ends-with: "WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!" + starts-with: "Preview URL:"