Skip to content

Conversation

malinajirka
Copy link
Contributor

This PR is an attempt at fixing the github action that drops a warning comment on dependabot contraint-layout updates. Since there is no way how to verify it works, I believe we just need to merge it and then test it on #14400.

@malinajirka malinajirka added this to the 23.3 milestone Sep 4, 2025
@malinajirka malinajirka added the category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. label Sep 4, 2025
@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit8a6d969
Direct Downloadwoocommerce-wear-prototype-build-pr14570-8a6d969.apk

@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit8a6d969
Direct Downloadwoocommerce-prototype-build-pr14570-8a6d969.apk

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes permissions for a GitHub Actions workflow that posts warning comments on Dependabot constraint-layout updates. The workflow was failing due to insufficient permissions when attempting to write comments on pull requests.

  • Changed trigger from pull_request to pull_request_target to enable write access
  • Added explicit pull-requests: write permission to allow comment posting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


on:
pull_request:
pull_request_target:
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using pull_request_target with Dependabot creates a security risk as it runs with write permissions in the context of the target repository. Consider adding explicit checks to verify the PR author is dependabot[bot] before any sensitive operations, or explore using pull_request with a GitHub token that has appropriate permissions.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is indeed it @malinajirka and we could use something like @wzieba did here: #14556

  1. Adding the permission at the top level instead:
permissions:
  pull-requests: write
  1. Using the GH_TOKEN environmental variable:
    env:
      PR_URL: ${{ github.event.pull_request.html_url }}
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1. And running the step with
      - name: Xyz
        ...
        with:
          github-token: "${{ secrets.GITHUB_TOKEN }}"

Then keep pull_request as is for now, then test it, wdyt? 🤔

@malinajirka malinajirka modified the milestones: 23.3, 23.6 Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants