Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using template to install workflow results in broken action #492

Closed
dfandrich opened this issue Jan 25, 2023 · 3 comments
Closed

Using template to install workflow results in broken action #492

dfandrich opened this issue Jan 25, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@dfandrich
Copy link
Contributor

The workflow template suggested when installing actions/labeler from a project's "New workflow" button results in a workflow using the pull_request event (instead of pull_request_target) that causes issues such as #446, #399, #136 and others.

To reproduce, go to a project and choose the Actions tab. Click the New workflow button, enter labeler into the Search workflows box and click Configure in the Label entry. This is the template that's given to submit:

# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration.  For more information, see:
# https://github.com/actions/labeler

name: Labeler
on: [pull_request]

jobs:
  label:

    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write

    steps:
    - uses: actions/labeler@v4
      with:
        repo-token: "${{ secrets.GITHUB_TOKEN }}"

Note the use of pull_request instead of pull_request_target.

@dfandrich dfandrich added bug Something isn't working needs triage labels Jan 25, 2023
@panticmilos
Copy link
Contributor

hi @dfandrich, thank you for the report we will take a look at it.

@panticmilos panticmilos self-assigned this Jan 25, 2023
@panticmilos
Copy link
Contributor

hi @dfandrich, we have prepared PR to fix this.

@panticmilos
Copy link
Contributor

hi @dfandrich, here is the merged fix. I will close this issue, if you have any additional questions feel free to continue the conversation here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants