From 7ac610a3cba7cc937384a7dc5e46ad2dd0bcbeed Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sun, 31 Aug 2025 15:04:38 +0100 Subject: [PATCH] Internals: Add 'RTLMeter PR results' workflow Workflows triggered for a PR from a fork can never have write permissions, so to post a comment on a PR, it must be done from a separate workflow triggered by 'workflow_run' in the main repository. --- .github/workflows/rtlmeter-pr-results.yml | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/rtlmeter-pr-results.yml diff --git a/.github/workflows/rtlmeter-pr-results.yml b/.github/workflows/rtlmeter-pr-results.yml new file mode 100644 index 000000000..4a4a42ecb --- /dev/null +++ b/.github/workflows/rtlmeter-pr-results.yml @@ -0,0 +1,35 @@ +--- +# DESCRIPTION: Github actions config +# This name is key to badges in README.rst, so we use the name build +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +name: RTLMeter PR results + +on: + workflow_run: + workflows: + - RTLMeter + types: + - completed + +jobs: + publish: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} + permissions: + actions: read + pull-requests: write + steps: + - name: Download report + uses: actions/github-script@v7 + with: + name: rtlmeter-pr-results + run-id: ${{ github.event.workflow_run.id }} + github-tokne: ${{ secrets.GITHUB_TOKEN }} + - name: Comment on PR + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ls -la + cat report.txt + gh pr --repo ${{ github.repository }} comment ${{ github.event.workflow_run.pull_requests[0].number }} --body-file report.txt