From 87dc516cb55a86d716246493dc531da7e1294322 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Tue, 16 Dec 2025 17:30:17 +0100 Subject: [PATCH] Fix PR comments for forked submissions --- .github/workflows/pr-check-pictures.yml | 43 ++++++++++++------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pr-check-pictures.yml b/.github/workflows/pr-check-pictures.yml index 583c064f94..bfa826e6c6 100644 --- a/.github/workflows/pr-check-pictures.yml +++ b/.github/workflows/pr-check-pictures.yml @@ -1,7 +1,7 @@ name: "Check new board assets exist (images + vendor logos)" on: - pull_request: + pull_request_target: paths: - "config/boards/**" @@ -20,6 +20,7 @@ jobs: permissions: contents: read pull-requests: write + issues: write steps: - name: "Checkout build repo (PR head)" @@ -71,12 +72,11 @@ jobs: comment_file="$(mktemp)" { - echo "" echo "This PR adds new board configuration(s). Required assets must already exist in [github/${WEBSITE_REPO}](https://github.com/${WEBSITE_REPO})." echo "They are required by [Armbian Imager](https://github.com/armbian/imager) to ensure all boards are displayed with proper images." echo "" - echo "- Board images: \`${BOARD_IMAGES_DIR}/.png\`" - echo "- Vendor logos: \`${VENDOR_LOGOS_DIR}/-logo.png\`" + echo "- Board images: \`${BOARD_IMAGES_DIR}/.png\` (1920x1080 px transparent)" + echo "- Vendor logos: \`${VENDOR_LOGOS_DIR}/-logo.png\` (512x512 px transparent)" echo "" echo "### Missing items" echo "" @@ -126,7 +126,7 @@ jobs: if [[ -z "${found_logo}" ]]; then { echo "- ❌ **Vendor logo missing** for vendor \`${vendor}\` (used by board \`${board}\`)" - echo " - Expected: \`${VENDOR_LOGOS_DIR}/${vendor}-logo.(png|jpg|jpeg|svg)\`" + echo " - Expected: \`${VENDOR_LOGOS_DIR}/${vendor}-logo.png\`" echo " - Fix: add the file to **${WEBSITE_REPO}** (folder \`${VENDOR_LOGOS_DIR}/\`)" echo " - Naming rules: lowercase, dashes (e.g. \`kobol-logo.png\`, not \`Kobol_logo.png\`)" echo "" @@ -146,25 +146,24 @@ jobs: fi - name: "Comment on PR with missing asset instructions" - if: always() && github.event_name == 'pull_request' && steps.validate.outputs.missing == 'true' + if: always() && github.event_name == 'pull_request_target' && steps.validate.outputs.missing == 'true' uses: actions/github-script@v7 env: - COMMENT_BODY: ${{ steps.validate.outputs.comment }} - WEBSITE_REPO: ${{ env.WEBSITE_REPO }} + COMMENT_BODY: ${{ steps.validate.outputs.comment }} + WEBSITE_REPO: ${{ env.WEBSITE_REPO }} with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const body = - `### 🚫 Missing required board assets + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const body = + `### 🚫 Missing required board assets - ${process.env.COMMENT_BODY} + ${process.env.COMMENT_BODY} - Once the missing files are added (or a PR is opened in **${process.env.WEBSITE_REPO}**), re-run this check. - `; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body - }); + Once the missing files are added (or a PR is opened in **${process.env.WEBSITE_REPO}**), re-run this check. + `; + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body + });