Skip to content

Commit

Permalink
chore: test out pulling issue number with action-script action
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <[email protected]>
  • Loading branch information
onedr0p committed Dec 24, 2023
1 parent ee5c52f commit b0a3ec6
Showing 1 changed file with 37 additions and 13 deletions.
50 changes: 37 additions & 13 deletions .github/workflows/lychee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: "Lychee"

on:
workflow_dispatch:
push:
branches: ["main"]
paths: [".github/workflows/lychee.yaml"]
schedule:
- cron: "0 0 * * *"

Expand All @@ -27,18 +30,39 @@ jobs:
with:
token: "${{ steps.app-token.outputs.token }}"

- name: Scan for broken links
uses: lycheeverse/lychee-action@v1
id: lychee
- name: Find Link Checker Issue
uses: actions/github-script@v7
with:
token: "${{ steps.app-token.outputs.token }}"
args: --verbose --no-progress --exclude-mail './**/*.md'
output: /tmp/results.md
script: |
const query = `query($owner:String!, $name:String!, $title:String!) {
repository(owner:$owner, name:$name){
issues(first:100, in: $title) {
nodes {
id
}
}
}
}`;
const variables = {
owner: context.repo.owner,
name: context.repo.repo,
title 'Link Checker Dashboard 🔗'
}
const result = await github.graphql(query, variables)
console.log(result)
- name: Update Issue
uses: peter-evans/create-issue-from-file@v4
with:
token: "${{ steps.app-token.outputs.token }}"
title: Link Checker Dashboard 🔗
issue-number: "${{ env.WORKFLOW_ISSUE_NUMBER }}"
content-filepath: /tmp/results.md
# - name: Scan for broken links
# uses: lycheeverse/lychee-action@v1
# env:
# GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
# with:
# args: --verbose --no-progress --exclude-mail './**/*.md'
# output: /tmp/results.md

# - name: Update Issue
# uses: peter-evans/create-issue-from-file@v4
# with:
# token: "${{ steps.app-token.outputs.token }}"
# title: Link Checker Dashboard 🔗
# issue-number: "${{ env.WORKFLOW_ISSUE_NUMBER }}"
# content-filepath: /tmp/results.md

0 comments on commit b0a3ec6

Please sign in to comment.