From 246cab9f96ccf9f6cb4e479ce8277624efb9d394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Jurczak?= Date: Tue, 10 Jun 2025 09:37:07 +0200 Subject: [PATCH] Fix token related error while adding PR comment https://github.com/splunk/public-o11y-docs/actions/runs/15490506134 - add label on PR from forked repositories branches - add comment on PR from splunk/public-o11y-docs branch --- .github/workflows/heretto-reminder.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/heretto-reminder.yml b/.github/workflows/heretto-reminder.yml index 9b201e80f..dad38ab3b 100644 --- a/.github/workflows/heretto-reminder.yml +++ b/.github/workflows/heretto-reminder.yml @@ -17,7 +17,20 @@ jobs: steps: + - name: Add PR label + if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['heretto'] + }) - name: Add PR Comment + if: ${{ github.head_ref == 'repo-sync' }} uses: actions/github-script@v6 with: github-token: ${{ secrets.MY_TOKEN }}