BobAnkh / add-contributors

A Github Action to add contributors to your file automatically. Feel free to contribute!
https://github.com/marketplace/actions/auto-add-contributors
Apache License 2.0
33 stars 20 forks source link

[bug] can't make it work with simple use-case. #27

Closed z0ph closed 3 years ago

z0ph commented 3 years ago

Describe the bug

Exception: The file where contributors are trying to be written 'README.md' does not have '### Contributors

I've tried with /README.md and README.md, I've tried with just ### Contributors section with just blank line just after. Nothing is working.

To Reproduce

name: Add contributors
on:
  schedule:
    - cron:  '20 20 * * *'
  push:
    branches:
      - dev

jobs:
  add-contributors:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: BobAnkh/add-contributors@master
      with:
        REPO_NAME: 'zoph-io/awscon-onepager'
        CONTRIBUTOR: '### Contributors'
        COLUMN_PER_ROW: '6'
        ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
        IMG_WIDTH: '60'
        FONT_SIZE: '10'
        PATH: 'README.md'
        COMMIT_MESSAGE: 'docs(README): update contributors'
        AVATAR_SHAPE: 'round'

Expected behavior

Update contributors in README.md

Screenshots

image

boring-cyborg[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

gitmagic-app[bot] commented 3 years ago

All sorted. :thumbsup:

BobAnkh commented 3 years ago

@z0ph Sorry I have been busy in the past few days. I'm looking into this bug now.

BobAnkh commented 3 years ago

I have located the bug. I didn't support other branches like dev in the current version. I will quickly fix it in several hours with a new version.

Sorry for causing you the trouble.

BobAnkh commented 3 years ago

@z0ph I think I have fixed it. Please check.

You can use PATH: 'dev:/README.md' to specify the file not on default branch.

BobAnkh commented 3 years ago

I didn't set it to detect current branch automatically. That is because the trigger-events have too many kinds, which is not easy to handle. But if you are interested in this work or if you have better ideas, please tell me. I would really like to imporve thie action.

z0ph commented 3 years ago

Hi @BobAnkh

Thanks for this update, but it doesn't seem to work for me, maybe I'm wrong:

image

You can see my branch here: https://github.com/zoph-io/awscon-onepager/tree/dev

Thanks for your help!

BobAnkh commented 3 years ago

@z0ph

Hi, I know what happens. In my action, I'm locating the part by searching something like ## Contributors\n\n, but here in your README.md, this is only one '\n' after ## Contributors.

This is kind of a bug. I will fix it right now. (Simply move this part in the middle of your markdown file will fix the problem, though)

Sorry for causing you the trouble.

z0ph commented 3 years ago

@z0ph

Hi, I know what happens. In my action, I'm locating the part by searching something like ## Contributors\n\n, but here in your README.md, this is only one '\n' after ## Contributors.

This is kind of a bug. I will fix it right now. (Simply move this part in the middle of your markdown file will fix the problem, though)

Sorry for causing you the trouble.

It's working! Thanks!

BobAnkh commented 3 years ago

@z0ph

Ok, I just want to tell you that I have fixed the bug just now.

Really thank you for pointing out this bug and help me to solve this.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue.