Skip to content

Commit

Permalink
added comment stage
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottGibb committed Nov 28, 2024
1 parent 1dcb5ec commit 90b77a4
Showing 1 changed file with 71 additions and 47 deletions.
118 changes: 71 additions & 47 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
Please review the changes and merge if they are correct.
base: ${{ github.head_ref }}

- name: Create PR output
- name: Post PR Comment
if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
Expand All @@ -151,53 +151,77 @@ jobs:
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
run: |
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
# Push new commit if applicable
# (for now works only on PR from same repository, not from forks)
- name: Prepare commit
if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'commit' &&
github.ref != 'refs/heads/main' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
run: sudo chown -Rc $UID .git/

- name: Commit and push applied linter fixes
uses: stefanzweifel/git-auto-commit-action@v5
if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'commit' &&
github.ref != 'refs/heads/main' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
uses: marocchino/sticky-pull-request-comment@v2
with:
branch: >-
${{
github.event.pull_request.head.ref ||
github.head_ref ||
github.ref
}}
commit_message: "[MegaLinter] Apply linters fixes"
commit_user_name: megalinter-bot
commit_user_email: nicolas.vuillamy@ox.security
message: |
MegaLinter has automatically applied linters fixes on this PR.
Please review the changes and merge if they are correct.
PR: ${{ steps.cpr.outputs.pull-request-url }}
hide_and_recreate: true


# Create PR Comment

# - name: Create PR output
# if: >-
# steps.ml.outputs.has_updated_sources == 1 &&
# (
# env.APPLY_FIXES_EVENT == 'all' ||
# env.APPLY_FIXES_EVENT == github.event_name
# ) &&
# env.APPLY_FIXES_MODE == 'pull_request' &&
# (
# github.event_name == 'push' ||
# github.event.pull_request.head.repo.full_name == github.repository
# ) &&
# !contains(github.event.head_commit.message, 'skip fix')
# run: |
# echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
# echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"

# # Push new commit if applicable
# # (for now works only on PR from same repository, not from forks)
# - name: Prepare commit
# if: >-
# steps.ml.outputs.has_updated_sources == 1 &&
# (
# env.APPLY_FIXES_EVENT == 'all' ||
# env.APPLY_FIXES_EVENT == github.event_name
# ) &&
# env.APPLY_FIXES_MODE == 'commit' &&
# github.ref != 'refs/heads/main' &&
# (
# github.event_name == 'push' ||
# github.event.pull_request.head.repo.full_name == github.repository
# ) &&
# !contains(github.event.head_commit.message, 'skip fix')
# run: sudo chown -Rc $UID .git/

# - name: Commit and push applied linter fixes
# uses: stefanzweifel/git-auto-commit-action@v5
# if: >-
# steps.ml.outputs.has_updated_sources == 1 &&
# (
# env.APPLY_FIXES_EVENT == 'all' ||
# env.APPLY_FIXES_EVENT == github.event_name
# ) &&
# env.APPLY_FIXES_MODE == 'commit' &&
# github.ref != 'refs/heads/main' &&
# (
# github.event_name == 'push' ||
# github.event.pull_request.head.repo.full_name == github.repository
# ) &&
# !contains(github.event.head_commit.message, 'skip fix')
# with:
# branch: >-
# ${{
# github.event.pull_request.head.ref ||
# github.head_ref ||
# github.ref
# }}
# commit_message: "[MegaLinter] Apply linters fixes"
# commit_user_name: megalinter-bot
# commit_user_email: nicolas.vuillamy@ox.security

cargo_fmt:
name: Cargo Formatter
Expand Down

0 comments on commit 90b77a4

Please sign in to comment.