Logerfo / close-label

A Probot app that applies a specific label to an issue closed through a pull request considering its current labels.
ISC License
5 stars 5 forks source link

error when running as github action #174

Open matthewmayer opened 4 years ago

matthewmayer commented 4 years ago
src/index.ts:52:48 - error TS2339: Property 'issues' does not exist on type 'GitHubAPI'.

52             const issue = await context.github.issues.get(context.issue({
                                                  ~~~~~~

src/index.ts:55:57 - error TS7006: Parameter 'label' implicitly has an 'any' type.

55             const currentLabels = issue.data.labels.map(label => label.name)
                                                           ~~~~~

src/index.ts:81:34 - error TS2339: Property 'issues' does not exist on type 'GitHubAPI'.

81             await context.github.issues.addLabels(context.issue({
                                    ~~~~~~
Logerfo commented 4 years ago

What branch/tag/commit did you use as target?

matthewmayer commented 4 years ago

logerfo/close-label@0.0.4

matthewmayer commented 4 years ago

My whole YML looks like this

name: Close-label
on:
- pull_request

jobs:
  triage:
    runs-on: ubuntu-latest
    steps:
    - uses: logerfo/close-label@0.0.4
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
Logerfo commented 4 years ago

Hmm I think it won't work unless I distribute the transpiled js, like I've done for non-probot actions like gitflow-action (the release branch). This may also be relevant. I have published several working actions, but this one is the only based on probot because it was not intended to be an action, since it was done before actions actually exist. The official server is still running as the original purpose and anyone can use it. If you don't feel secure using my hosted version, also feel free to fork my project and host it yourself. In the meanwhile, I don't know when I'll have time to take a better look at this, but I'd gladly merge a PR fixing it (or do the job myself if I had some confirmation that distributing the js will solve the issue completely by itself) if it's of anyone's interest. Thank you for reporting.

matthewmayer commented 4 years ago

So just to clarify if I follow the steps for

Using the bot as a GitHub app

Install the app through the GitHub Marketplace.

It should work?

Logerfo commented 4 years ago

Yes.

Lissy93 commented 3 years ago

Hiya, love your action idea, was looking for exactly this! Nice work :) But I'm getting exactly the same issue as above, when running as an action, using my own bot.

For refence, here is my workflow file which produces this result, and here are the full logs.

It also looks like a lot of the dependencies are very out-of-date, as several deprecation warnings and security advisories were thrown. Is this action still maintained? If not, it should probably be removed from the marketplace.

Logerfo commented 3 years ago

@Lissy93 I'm open to review and merge any pull requests, but I'm not working on this project myself. As this is not running as a web application, I don't think security advisories from dependencies should be an issue. Regardless, I remember configuring "renovate" bot to update dependencies automatically. If you issue a pull request fixing the bug or updating any problematic dependency, I'll be glad to merge it.