File tree Expand file tree Collapse file tree 19 files changed +8756
-26566
lines changed Expand file tree Collapse file tree 19 files changed +8756
-26566
lines changed Original file line number Diff line number Diff line change 1+ name : Auto LGTM Image Submitter
2+
3+ on :
4+ pull_request_review :
5+ types : [submitted]
6+
7+ jobs :
8+ build :
9+ if : ${{ github.event.review.state == 'approved' }}
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v2
13+
14+ - uses : lazy-actions/lgtm-image-action@main
15+ with :
16+ repo-token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Build
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ paths :
8+ - " **.ts"
9+ - " package.json"
10+ - " yarn.lock"
11+ - " tsconfig.json"
12+
13+ jobs :
14+ build :
15+ name : Transpile Typescript
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v2
19+
20+ - uses : actions/setup-node@v2
21+ with :
22+ node-version : ' 14'
23+
24+ - name : Setup workspace
25+ run : yarn install --frozen-lockfile
26+
27+ - name : Transpile
28+ run : yarn run build
29+
30+ - name : Push changes
31+ run : |
32+ git config user.name "${GITHUB_ACTOR}"
33+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
34+ git add .
35+ git commit -m "build: Transpile" || echo "No changes to commit"
36+ git push origin HEAD
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Tests
2+
3+ on : pull_request
4+
5+ jobs :
6+ test :
7+ name : Test
8+ runs-on : ubuntu-latest
9+ steps :
10+ - uses : actions/checkout@v2
11+
12+ - uses : actions/setup-node@v2
13+ with :
14+ node-version : ' 14'
15+
16+ - name : Setup workspace
17+ run : yarn install --frozen-lockfile
18+
19+ - name : Format check
20+ run : yarn run format:check
21+
22+ - name : Run test
23+ run : yarn run test
Original file line number Diff line number Diff line change 22.config /
33.npm /
44node_modules /
5- yarn-error.log
5+ yarn-error.log
6+ .node-version
7+ .vscode /
Original file line number Diff line number Diff line change 11{
2- "printWidth" : 80 ,
3- "tabWidth" : 2 ,
4- "useTabs" : false ,
5- "semi" : true ,
6- "singleQuote" : true ,
7- "trailingComma" : " none" ,
8- "bracketSpacing" : false ,
9- "arrowParens" : " avoid" ,
10- "parser" : " typescript"
11- }
2+ "printWidth" : 80 ,
3+ "tabWidth" : 2 ,
4+ "useTabs" : false ,
5+ "semi" : true ,
6+ "singleQuote" : true ,
7+ "trailingComma" : " none" ,
8+ "bracketSpacing" : false ,
9+ "arrowParens" : " avoid" ,
10+ "parser" : " typescript"
11+ }
Original file line number Diff line number Diff line change 11# Slatify
22
3- ![ GitHub Workflow] ( https://github.com/lazy-actions/slatify/workflows/lint/badge.svg )
3+ ![ Build] ( https://img.shields.io/github/workflow/status/lazy-actions/slatify/Build?label=build )
4+ ![ Test] ( https://img.shields.io/github/workflow/status/lazy-actions/slatify/Tests?label=test )
45![ GitHub release (latest by date)] ( https://img.shields.io/github/v/release/lazy-actions/slatify?color=brightgreen )
56![ GitHub] ( https://img.shields.io/github/license/lazy-actions/slatify?color=brightgreen )
67[ ![ code style: prettier] ( https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square )] ( https://github.com/prettier/prettier )
Original file line number Diff line number Diff line change 1+ import * as github from '@actions/github' ;
2+ import { getWorkflowUrls } from '../src/github' ;
3+
4+ export const commonContext = {
5+ workflow : 'test' ,
6+ ref : '1' ,
7+ sha : '2' ,
8+ owner : 'lazy-actions' ,
9+ repo : 'slatify' ,
10+ number : 3
11+ } ;
12+ export const repoUrl = `https://github.com/${ commonContext . owner } /${ commonContext . repo } ` ;
13+
14+ github . context . workflow = commonContext . workflow ;
15+ github . context . ref = commonContext . ref ;
16+ github . context . sha = commonContext . sha ;
17+ github . context . payload = {
18+ issue : {
19+ number : commonContext . number
20+ } ,
21+ repository : {
22+ owner : {
23+ login : commonContext . owner
24+ } ,
25+ name : commonContext . repo
26+ }
27+ } ;
28+
29+ describe ( 'Workflow URL Tests' , ( ) => {
30+ test ( 'Pull Request event' , ( ) => {
31+ github . context . eventName = 'pull_request' ;
32+ const expectedEventUrl = `${ repoUrl } /pull/${ commonContext . number } ` ;
33+ const expectedUrls = {
34+ repo : repoUrl ,
35+ event : expectedEventUrl ,
36+ action : `${ expectedEventUrl } /checks`
37+ } ;
38+ expect ( getWorkflowUrls ( ) ) . toEqual ( expectedUrls ) ;
39+ } ) ;
40+
41+ test ( 'Push event' , ( ) => {
42+ github . context . eventName = 'commit' ;
43+ const expectedUrls = {
44+ repo : repoUrl ,
45+ action : `${ repoUrl } /commit/${ commonContext . sha } /checks`
46+ } ;
47+ expect ( getWorkflowUrls ( ) ) . toEqual ( expectedUrls ) ;
48+ } ) ;
49+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ {
2+ "text" : " This is test" ,
3+ "attachments" : [
4+ {
5+ "color" : " danger" ,
6+ "blocks" : [
7+ {
8+ "type" : " section" ,
9+ "fields" : [
10+ {
11+ "type" : " mrkdwn" ,
12+ "text" : " Hello World"
13+ },
14+ {
15+ "type" : " mrkdwn" ,
16+ "text" : " YEAH!!!!!"
17+ }
18+ ]
19+ }
20+ ]
21+ }
22+ ]
23+ }
You can’t perform that action at this time.
0 commit comments