-
-
Notifications
You must be signed in to change notification settings - Fork 45
Create a pull request instead of committing directly #16
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,19 +17,24 @@ runs: | |
steps: | ||
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH | ||
shell: bash | ||
- name: Setup Git configurations | ||
shell: bash | ||
run: | | ||
git config --global user.name github-actions[bot] | ||
git config --global user.email 'github-actions@users.noreply.github.com' | ||
- name: Running the formatter | ||
shell: bash | ||
run: | | ||
filename_formatter.sh ${{ inputs.working-directory }} ${{ inputs.filetypes }} ${{ inputs.ignore-files }} | ||
- name: Committing changes | ||
|
||
git pull || true | ||
- name: Committing and pushing changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
id: commit-push | ||
with: | ||
commit_message: "chore: formatting filenames" | ||
branch: "formatting_files-${{ github.sha }}" | ||
create_branch: true | ||
- name: Creating and merging the PR | ||
shell: bash | ||
if: steps.commit-push.outputs.changes_detected == 'true' | ||
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 }} | ||
Comment on lines
36
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. But, sometimes GitHub Actions aren't enabled in forks, which then will be updated in our repository in case anything was missed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, I have time to get back to this now, hehe. EDIT: I sent you a few messages via Discord about this. Let's discuss it if you like. 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 😄 |
Uh oh!
There was an error while loading. Please reload this page.