blob: be1b007168a1d980e2d3c0ca99545d790d8d87fd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import React from 'dom-chef';
import select from 'select-dom';
import SearchIcon from 'octicon/search.svg';
import * as pageDetect from 'github-url-detection';
import features from '.';
function init(): void {
const actionRepo = select('aside .octicon-repo')!
.closest('a')!
.pathname
.slice(1);
const actionURL = new URL('search', location.origin);
actionURL.searchParams.set('q', `${actionRepo} path:.github/workflows/ language:YAML`);
actionURL.searchParams.set('type', 'Code');
actionURL.searchParams.set('s', 'indexed');
actionURL.searchParams.set('o', 'desc');
select('.d-block.mb-2[href^="/contact"]')!.after(
<a href={String(actionURL)} className="d-block mb-2">
<SearchIcon width={14} className="text-gray-dark mr-2"/>Usage examples
</a>
);
}
void features.add(__filebasename, {
include: [
pageDetect.isMarketplaceAction
],
init
});
|