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

Cannot get it to add any labels #4

Closed
AndrewLeedham opened this issue May 15, 2020 · 4 comments
Closed

Cannot get it to add any labels #4

AndrewLeedham opened this issue May 15, 2020 · 4 comments

Comments

@AndrewLeedham
Copy link

I don't seem to be able to get this action to add any labels.
Using the following workflow:

on:
  pull_request:
    types: [opened]
name: Add base branch label
jobs:
  base-branch:
    runs-on: ubuntu-latest
    steps:
      - name: Add base branch label
        uses: ffittschen/pr-branch-labeler@v1
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}

and the following pr-branch-labeler.yml

development:
  base: 'development'

stage:
  base: 'stage'

master:
  base: 'master'

The workflow is running, but there is no output (tested with both draft and normal PR) base branch was "development".

Unfortunately I am trying this in a private repo, otherwise I would share a link, but here are some screenshots:
image

image

image

@ffittschen
Copy link
Owner

Hi @AndrewLeedham, is the pr-branch-labeler.yml file already present in your repo or did you add it in the PR that also adds the workflow?

@AndrewLeedham
Copy link
Author

Hi @AndrewLeedham, is the pr-branch-labeler.yml file already present in your repo or did you add it in the PR that also adds the workflow?

It is part of the PR, guessing the action cannot access it in that case then?

@ffittschen
Copy link
Owner

Yes exactly, the action uses the octokit.repos.getContents() method without passing the ref, so it will look for the file in the default branch of the repository.

@AndrewLeedham
Copy link
Author

Gotcha, thanks for the fast response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants