Skip to content

fix: missleading errors #61

fix: missleading errors

fix: missleading errors #61

Workflow file for this run

---
name: MegaLinter
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
workflow_dispatch: null
workflow_call: null
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest
steps:
- name: Set up node.js 20
uses: actions/setup-node@4.3
with:
node-version: "20"
- name: Checkout
uses: actions/checkout@v4
- name: Copy linting config from r.workflows/main
shell: bash
run: |
curl --output .mega-linter.yml https://raw.githubusercontent.com/NovoNordisk-OpenSource/r.workflows/main/.github/linters/.mega-linter.yml
curl --output .lintr https://raw.githubusercontent.com/NovoNordisk-OpenSource/r.workflows/main/.github/linters/.lintr
curl --output .lycheeignore https://raw.githubusercontent.com/NovoNordisk-OpenSource/r.workflows/main/.github/linters/.lycheeignore
if [ -e "inst/WORDLIST" ]; then
curl --output .cspell.json https://raw.githubusercontent.com/NovoNordisk-OpenSource/r.workflows/main/.github/linters/.cspell-wordlist.json
else
curl --output .cspell.json https://raw.githubusercontent.com/NovoNordisk-OpenSource/r.workflows/main/.github/linters/.cspell.json
fi
- name: MegaLinter
id: ml
uses: oxsecurity/megalinter@latest
env:
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
APPLY_FIXES: all
APPLY_FIXES_EVENT: pull_request
APPLY_FIXES_MODE: pull_request
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |
megalinter-reports
mega-linter.log
- name: Create Pull Request with applied fixes
id: cpr
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')
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.access-token || secrets.ACTION_PAT || secrets.GITHUB_TOKEN}}
commit-message: "[MegaLinter] Apply linters automatic fixes"
title: "[MegaLinter] Apply linters automatic fixes"
labels: bot
- 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 "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- 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
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: stefanzweifel/git-auto-commit-action@v4
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: actions-robot@novonordisk.com