-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only interact with Tugboat for non-doc changes
- Loading branch information
Showing
5 changed files
with
71 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "VA.gov CMS Documentation Only PR Check" | ||
description: "Checks if the current PR contains only documentation changes" | ||
inputs: {} | ||
outputs: | ||
docs-only: | ||
description: "'true' if the PR contains only documentation changes, otherwise 'false'" | ||
value: ${{ steps.docs-only.outputs.result }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Check for documentation only changes | ||
id: docs-only | ||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | ||
with: | ||
script: | | ||
const opts = github.rest.pulls.listFiles.endpoint.merge({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.payload.pull_request.number, | ||
}) | ||
const files = await github.paginate(opts, (response) => | ||
response.data.map((file) => file.filename)) | ||
for (const file of files) { | ||
console.log(`Checking PR file: ${file}`) | ||
if (!file.endsWith('.md')) { | ||
console.log(`Code changes found in: ${file}`) | ||
return "false" | ||
} | ||
} | ||
return "true" | ||
result-encoding: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters