generated from actions/container-toolkit-action
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-any-fields
- Loading branch information
Showing
19 changed files
with
8,756 additions
and
26,566 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,16 @@ | ||
name: Auto LGTM Image Submitter | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
jobs: | ||
build: | ||
if: ${{ github.event.review.state == 'approved' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: lazy-actions/lgtm-image-action@main | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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,36 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- "**.ts" | ||
- "package.json" | ||
- "yarn.lock" | ||
- "tsconfig.json" | ||
|
||
jobs: | ||
build: | ||
name: Transpile Typescript | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Setup workspace | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Transpile | ||
run: yarn run build | ||
|
||
- name: Push changes | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git add . | ||
git commit -m "build: Transpile" || echo "No changes to commit" | ||
git push origin HEAD |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
name: Tests | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Setup workspace | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Format check | ||
run: yarn run format:check | ||
|
||
- name: Run test | ||
run: yarn run test |
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 |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
.config/ | ||
.npm/ | ||
node_modules/ | ||
yarn-error.log | ||
yarn-error.log | ||
.node-version | ||
.vscode/ |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid", | ||
"parser": "typescript" | ||
} | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid", | ||
"parser": "typescript" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import * as github from '@actions/github'; | ||
import {getWorkflowUrls} from '../src/github'; | ||
|
||
export const commonContext = { | ||
workflow: 'test', | ||
ref: '1', | ||
sha: '2', | ||
owner: 'lazy-actions', | ||
repo: 'slatify', | ||
number: 3 | ||
}; | ||
export const repoUrl = `https://github.com/${commonContext.owner}/${commonContext.repo}`; | ||
|
||
github.context.workflow = commonContext.workflow; | ||
github.context.ref = commonContext.ref; | ||
github.context.sha = commonContext.sha; | ||
github.context.payload = { | ||
issue: { | ||
number: commonContext.number | ||
}, | ||
repository: { | ||
owner: { | ||
login: commonContext.owner | ||
}, | ||
name: commonContext.repo | ||
} | ||
}; | ||
|
||
describe('Workflow URL Tests', () => { | ||
test('Pull Request event', () => { | ||
github.context.eventName = 'pull_request'; | ||
const expectedEventUrl = `${repoUrl}/pull/${commonContext.number}`; | ||
const expectedUrls = { | ||
repo: repoUrl, | ||
event: expectedEventUrl, | ||
action: `${expectedEventUrl}/checks` | ||
}; | ||
expect(getWorkflowUrls()).toEqual(expectedUrls); | ||
}); | ||
|
||
test('Push event', () => { | ||
github.context.eventName = 'commit'; | ||
const expectedUrls = { | ||
repo: repoUrl, | ||
action: `${repoUrl}/commit/${commonContext.sha}/checks` | ||
}; | ||
expect(getWorkflowUrls()).toEqual(expectedUrls); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
{ | ||
"text": "This is test", | ||
"attachments": [ | ||
{ | ||
"color": "danger", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "Hello World" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "YEAH!!!!!" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.