Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JackDevAU committed Nov 8, 2023
1 parent cec4ea1 commit 0cb5408
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions .github/workflows/validate-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

# # Step 2: Set up the Node.js environment.
# - uses: actions/setup-node@v3

# Step 3: Get the list of changed files in the PR
- name: Get changed files
id: get_changed
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "changed=$(git diff --name-only $(git merge-base origin/main HEAD) HEAD)" | paste -sd "," - >> $GITHUB_ENV
echo "pr_owner=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
# Step 4: Lint + Validate Markdown files
- name: Lint Markdown
id: check_markdown
uses: articulate/actions-markdownlint@v1
- uses: articulate/actions-markdownlint@v1
with:
config: ./.markdownlint/config.json
files: ${{ env.changed }}
ignore: node_modules

# Step 5: Write workflow job summary if the previous step failed
- name: Add Job Summary
if: failure()
run: |
echo "Hi @$pr_owner," >> $GITHUB_STEP_SUMMARY
echo "${{ steps.check_markdown.outputs.stdout }}" >> $GITHUB_STEP_SUMMARY
# Step 6: Leave a comment if the validation has failed and if it's not a PR from a fork
- name: Comment on PR
if: failure() && github.event.pull_request.head.repo.fork == false
uses: mshick/add-pr-comment@v2
with:
message: |
Hi @${{ env.pr_owner }},
${{ steps.check_markdown.outputs.stdout }}
Please fix your Markdown files.
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: "github-actions[bot]"
allow-repeats: true

0 comments on commit 0cb5408

Please sign in to comment.