Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
---
name: Lint
on:
pull_request:
branches: [main]
paths:
- 'src/pages/**'

jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Lint
id: lint
continue-on-error: true
run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v
name: Lint
on:
pull_request:
branches: [main]
paths:
- 'src/pages/**'

- name: Post Linter Report to PR
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_ID: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
npm install --no-save github:AdobeDocs/adp-devsite-scripts
node node_modules/adp-devsite-scripts/linter-bot/postLinterReport.js
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Fail if linter found errors
if: steps.lint.outcome == 'failure'
run: exit 1
- name: Lint
id: lint
continue-on-error: true
run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v

- name: Save PR number
if: always()
run: echo "${{ github.event.pull_request.number }}" > pr-number.txt

- name: Upload linter report
if: always()
uses: actions/upload-artifact@v4
with:
name: linter-report
path: |
linter-report.txt
pr-number.txt

- name: Fail if linter found errors
if: steps.lint.outcome == 'failure'
run: exit 1
32 changes: 32 additions & 0 deletions .github/workflows/post-lint-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Post Linter Report
on:
workflow_run:
workflows: ["Lint"]
types:
- completed

permissions:
pull-requests: write

jobs:
comment:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Download linter report artifact
uses: actions/download-artifact@v4
with:
name: linter-report
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Post Linter Report to PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
LINTER_REPORT_PATH: ./linter-report.txt
PR_NUMBER_PATH: ./pr-number.txt
run: |
npm install --no-save github:AdobeDocs/adp-devsite-scripts
node node_modules/adp-devsite-scripts/linter-bot/postLinterReport.js