Skip to content

Commit

Permalink
get input; update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsdennis committed Aug 24, 2023
1 parent 11cc148 commit f64002d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ The action can detect links in the following styles:
- Quick Link: `#5`
- Partial Link: `gregsdennis/dependencies-action#5`
- Partial URL: `gregsdennis/dependencies-action/pull/5`
- Full URL: `http://github.com/gregsdennis/dependencies-action/pull/5`
- Markdown: `[markdown link](http://github.com/gregsdennis/dependencies-action/pull/5)`
- Full URL: `https://github.com/gregsdennis/dependencies-action/pull/5`
- Markdown: `[markdown link](https://github.com/gregsdennis/dependencies-action/pull/5)`

Works for both issues and PRs!

Also supports custom domains for use with GitHub Enterprise!

## See it in action:

- [PR to be landed first](http://github.com/gregsdennis/dependencies-action/pull/4)
Expand All @@ -34,6 +36,9 @@ jobs:
name: Check Dependencies
steps:
- uses: gregsdennis/dependencies-action@main
with:
custom-domains:
- my-custom-domain.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// const core = require('@actions/core');
// const github = require('@actions/github');
const core = require('@actions/core');
const github = require('@actions/github');

var customDomains = core.getInput('custom-domains') ?? [];

const keyPhrases = 'depends on|blocked by';
const issueTypes = 'issues|pull';
const domainsList = ['github.com', 'custom-domain.edu']; // add others from parameter
const domainsList = ['github.com'].concat(customDomains); // add others from parameter
const domainsString = combineDomains(domainsList);

const quickLinkRegex = new RegExp(`(${keyPhrases}) #(\\d+)`, 'gmi');
Expand Down

0 comments on commit f64002d

Please sign in to comment.