| name: Create content auto-fix PR |
|
|
| on: |
| schedule: |
| - cron: "0 0 * * *" |
| workflow_dispatch: |
|
|
| |
| |
| permissions: {} |
|
|
| jobs: |
| fix: |
| if: github.repository == 'mdn/content' |
| runs-on: ubuntu-latest |
|
|
| steps: |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 |
| with: |
| persist-credentials: false |
|
|
| - name: Setup Node.js environment |
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f |
| with: |
| node-version-file: ".nvmrc" |
| package-manager-cache: false |
|
|
| - name: Install |
| run: npm ci |
| env: |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| LEFTHOOK: 0 |
|
|
| - name: Lint markdown files |
| run: | |
| npm run content fix-flaws |
| npm run fix:md |
| npm run fix:fm |
| node scripts/sort_and_unique_file_lines.js .vscode/dictionaries |
| env: |
| |
| |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
| - name: Create PR with only fixable issues |
| if: success() |
| uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 |
| with: |
| commit-message: "chore: auto-fix Markdownlint, Prettier, and front-matter issues" |
| branch: markdownlint-auto-cleanup |
| title: "fix: auto-cleanup by bot" |
| author: mdn-bot <108879845+mdn-bot@users.noreply.github.com> |
| committer: mdn-bot <108879845+mdn-bot@users.noreply.github.com> |
| body: | |
| This PR was generated by [this run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) of the [`auto-cleanup-bot`](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/auto-cleanup-bot.yml) workflow. |
| |
| All issues were auto-fixed. |
| labels: | |
| automated pr |
| token: ${{ secrets.AUTOMERGE_TOKEN }} |
|
|
| - name: Create PR with notice on unfixed issues |
| if: failure() |
| uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 |
| with: |
| commit-message: "chore: auto-fix Markdownlint, Prettier, and front-matter issues" |
| branch: markdownlint-auto-cleanup |
| title: "fix: auto-cleanup by bot" |
| author: mdn-bot <108879845+mdn-bot@users.noreply.github.com> |
| committer: mdn-bot <108879845+mdn-bot@users.noreply.github.com> |
| body: | |
| This PR was generated by the [`auto-cleanup-bot`](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/.github/workflows/auto-cleanup-bot.yml) workflow. |
| |
| Auto-fix was run, but additional issues found. |
| Please review the [run log](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). |
| labels: | |
| automated pr |
| token: ${{ secrets.AUTOMERGE_TOKEN }} |
|
|