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

[bug] make it so that the action can submit a pull request to update the changelog #78

Closed
mmattbtw opened this issue Dec 28, 2021 · 13 comments
Labels
bug Something isn't working

Comments

@mmattbtw
Copy link

Is your feature request related to a problem? Please describe

My problem is that my main branch is protected with some required statuses that much be passed. The action tries to push it to the branch directly instead of using a pull request to submit new changes. Which gives this error:

github.GithubException.GithubException: 409 {"message": "Could not update file: 2 of 2 required status checks are expected. Changes must be made through a pull request.", "documentation_url": "docs.github.com/articles/about-protected-branches"}

Description of the new feature/enhancement

I would want the action to either submit a new pull request to update the changelog, or to update the changelog inside of the pull request itself.

Proposed technical implementation details (optional)

A clear and concise description of any solutions you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@mmattbtw mmattbtw added the enhancement New feature or request label Dec 28, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Dec 28, 2021

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

@gitmagic-app
Copy link

gitmagic-app bot commented Dec 28, 2021

Everything looks good 👍

1 similar comment
@gitmagic-app
Copy link

gitmagic-app bot commented Dec 28, 2021

Everything looks good 👍

@BobAnkh
Copy link
Owner

BobAnkh commented Dec 29, 2021

Hi, I want to know if the option BRANCH and PULL_REQUEST can not be directly used in your case?

image

@mmattbtw
Copy link
Author

@BobAnkh
Copy link
Owner

BobAnkh commented Dec 29, 2021

Ok, I think it is my fault that I didn't explain how to use this feature clearly.

This is your originnal workflow:

jobs:
  generate-changelog:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - uses: BobAnkh/auto-generate-changelog@master
      with:
        REPO_NAME: 'mmattDonk/AI-TTS-Donations'
        ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
        PATH: '/CHANGELOG.md'
        COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
        TYPE: 'feat:Feature,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'
        BRANCH: ''
        PULL_REQUEST: 'true'

Here you should specify the pull request from what BRANCH to what PULL_REQUEST branch. For example, set BRANCH to docs/changelog and set PULL_REQUEST to main and you will get a pull request opened from docs/changelog to main.

jobs:
  generate-changelog:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - uses: BobAnkh/auto-generate-changelog@master
      with:
        REPO_NAME: 'mmattDonk/AI-TTS-Donations'
        ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
        PATH: 'CHANGELOG.md'
        COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
        TYPE: 'feat:Feature,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'
-        BRANCH: ''
+       BRANCH: 'docs/changelog'
-        PULL_REQUEST: 'true'
+       PULL_REQUEST: 'main'

Use BRANCH to specify where you want to push your changelog first, and use PULL_REQUEST to specify the target branch you want to open a pr. I design this for people who want to push changelog to other branches with or without a pull request.

@BobAnkh
Copy link
Owner

BobAnkh commented Dec 29, 2021

Ok, thank you. There is a typo leading to the bug. I have fixed it now. Could you please help me test it? Really appreciate your help.

@mmattbtw
Copy link
Author

It finished successfully, but didn't make a pr :/ https://github.com/mmattDonk/AI-TTS-Donations/runs/4656755807?check_suite_focus=true

@BobAnkh
Copy link
Owner

BobAnkh commented Dec 29, 2021

I see. I will try to debug this.

@BobAnkh
Copy link
Owner

BobAnkh commented Dec 29, 2021

It turns out to be that:

The changelog file will not be created if it has no difference between the new-generated one in action and the current one.

Here is my design trade-off for this. I originally not want to push same things again and again. That is why the pull request not opened.

If you want to see it, just delete the branch docs/changelog and re-run the workflow. Also I will release a new version contains those bug-fixes in master branch.

@BobAnkh BobAnkh added bug Something isn't working and removed enhancement New feature or request labels Dec 30, 2021
@BobAnkh
Copy link
Owner

BobAnkh commented Dec 30, 2021

Hey, if everything works well now, then I will close this issue.

Many thanks for reporting this bug.

Repository owner deleted a comment from gitmagic-app bot Dec 30, 2021
@BobAnkh BobAnkh changed the title [enhancement] make it so that the action can submit a pull request to update the changelog [bug] make it so that the action can submit a pull request to update the changelog Dec 30, 2021
Repository owner deleted a comment from gitmagic-app bot Dec 30, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2022

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants