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

Create a pull request instead of committing directly #16

Closed
wants to merge 2 commits into from

Conversation

Panquesito7
Copy link
Member

Things added/changed:

  • Create a pull request instead of committing directly.
    • The actions will now create a new branch with the current GitHub SHA, create a pull request, and merge it to the original branch (using GITHUB_REF). The branch will be later on deleted to keep things clean.
    • Tested and works. You can see all the (unclean) testing here.

@Panquesito7 Panquesito7 added the enhancement New feature or request label Mar 8, 2023
@Panquesito7 Panquesito7 requested a review from tjgurwara99 March 8, 2023 02:50
Copy link
Member

@tjgurwara99 tjgurwara99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me otherwise, though I would prefer a force push onto a separate branch and open a pr (if one doesn't exist) and let the maintainers merge it 😄

Comment on lines 36 to +40
run: |
git add ${{ inputs.working-directory }} || true
git commit -m "chore: formatting filenames" || true

git push origin HEAD:$GITHUB_REF || true
gh pr create --base ${GITHUB_REF##*/} --head formatting_files-${{ github.sha }} --title 'chore: formatting filenames' --body 'Formatted filenames (see the diff. for changes).'
gh pr merge --admin --merge --subject 'chore: formatting filenames' --delete-branch
env:
GH_TOKEN: ${{ github.token }}
Copy link
Member

@tjgurwara99 tjgurwara99 Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW on a personal level, I really think CI checks should help find out the problems for the contributors not fix them so I think fixing the filenames into the correct format automatically means that the contributor really never learns to read the contribution guidelines 😅 - our check should indicate to them that there is a problem with their PR with a comment or something instead of fixing it for them.

EDIT: This argument doesn't apply to the directory.md file since that our problem not the contributors problem 😄

Copy link
Member Author

@Panquesito7 Panquesito7 Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI actually updates the filenames in case the PR creator didn't follow our guidelines.
In this case, it would create a PR to their fork and update it automatically.

But, sometimes GitHub Actions aren't enabled in forks, which then will be updated in our repository in case anything was missed.

Copy link
Member Author

@Panquesito7 Panquesito7 Jun 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I have time to get back to this now, hehe.
I agree with you. Should I edit it so that the action fails if there's anything found, and specify where the error is?

EDIT: I sent you a few messages via Discord about this. Let's discuss it if you like. 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been off discord for a while haha, I'll check again soon 😄

@Panquesito7 Panquesito7 marked this pull request as draft March 8, 2023 23:47
directory_md/action.yml Outdated Show resolved Hide resolved
Co-authored-by: Christian Clauss <cclauss@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants