Skip to content

Action Needs Permissions to Comment #55

@griffin-ezbot

Description

@griffin-ezbot

Bug description

Using the recommended yml from the README.md:

name: Package Size Report

on:
  pull_request:
    branches: [ master, develop ] # ⬅ Add other branches you want size checks on

jobs:
  pkg-size-report:
    name: Package Size Report
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '14' # ⬅ Specify a version of Node.js to build your app

      - name: Package size report
        uses: pkg-size/action@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

results in the following error when the action is triggered:
Screenshot 2024-03-14 at 10 03 19 AM

Solution: add the following to your recommended yml

permissions:
  pull-requests: write

Reproduction steps

See above

Environment

  • pkg-size-action version: v1.1.1
  • Operating System: Local: MacOS 14.2.1, ubuntu-latest on the action itself
  • Node version: 20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions