Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #89 from technote-space/release/next-v2.2.2
Browse files Browse the repository at this point in the history
release: v3.0.0
  • Loading branch information
technote-space committed Jun 3, 2022
2 parents e0a46d6 + 2506f44 commit 3ac32f3
Show file tree
Hide file tree
Showing 19 changed files with 1,586 additions and 2,533 deletions.
51 changes: 9 additions & 42 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"plugin:@typescript-eslint/eslint-recommended"
],
"plugins": [
"@typescript-eslint"
"@typescript-eslint",
"import"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand All @@ -30,29 +31,6 @@
"properties": "always"
}
],
"require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true
}
}
],
"valid-jsdoc": [
"error",
{
"requireReturn": false,
"preferType": {
"String": "string",
"Object": "object",
"Number": "number",
"Function": "function",
"Void": "void"
}
}
],
"quotes": [
"error",
"single",
Expand All @@ -71,12 +49,6 @@
}
}
],
"no-magic-numbers": [
"error",
{
"ignoreArrayIndexes": true
}
],
"eqeqeq": "error",
"block-scoped-var": "error",
"complexity": [
Expand All @@ -85,7 +57,6 @@
"maximum": 20
}
],
"curly": "error",
"default-case": "error",
"dot-location": [
"error",
Expand All @@ -102,16 +73,6 @@
"after": true
}
],
"id-length": [
"error",
{
"min": 2,
"properties": "never",
"exceptions": [
"$"
]
}
],
"indent": [
"error",
2,
Expand Down Expand Up @@ -144,6 +105,12 @@
],
"semi": [
"error"
]
],
"sort-imports": 0,
"import/order": [2, {
"groups": ["type", "builtin", "external", "internal", "parent", "sibling", "index", "object"],
"alphabetize": { "order": "asc", "caseInsensitive": true }
}],
"@typescript-eslint/no-non-null-assertion": "off"
}
}
14 changes: 8 additions & 6 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,23 @@ jobs:

slack:
name: Slack
needs: publish # set needs only last job except this job
needs: publish # このjobを除いた最後のjobを"needs"に設定
runs-on: ubuntu-latest
if: always() # set always
if: always() # "always"を設定
steps:
# run this action to get workflow conclusion
# You can get conclusion via env (env.WORKFLOW_CONCLUSION)
- uses: technote-space/workflow-conclusion-action@v2
# workflowの結果を取得するためにこのアクションを実行
# 環境変数から結果を取得できます (env.WORKFLOW_CONCLUSION)
- uses: technote-space/workflow-conclusion-action@v3

# workflowの結果を使用してアクションを実行
- uses: 8398a7/action-slack@v3
with:
# status: ${{ env.WORKFLOW_CONCLUSION }} # neutral, success, skipped, cancelled, timed_out, action_required, failure
status: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
if: env.WORKFLOW_CONCLUSION == 'failure' # 失敗を通知する場合
```

### Success
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ jobs:

slack:
name: Slack
needs: publish # set needs only last job except this job
needs: publish # set "needs" only last job except this job
runs-on: ubuntu-latest
if: always() # set always
if: always() # set "always"
steps:
# run this action to get workflow conclusion
# You can get conclusion via env (env.WORKFLOW_CONCLUSION)
- uses: technote-space/workflow-conclusion-action@v2
# run this action to get the workflow conclusion
# You can get the conclusion via env (env.WORKFLOW_CONCLUSION)
- uses: technote-space/workflow-conclusion-action@v3

# run other action with the workflow conclusion
- uses: 8398a7/action-slack@v3
with:
# status: ${{ env.WORKFLOW_CONCLUSION }} # neutral, success, skipped, cancelled, timed_out, action_required, failure
Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ inputs:
GITHUB_TOKEN:
description: Secret GitHub API token to use for making API requests.
default: ${{ github.token }}
required: true
required: false
TARGET_RUN_ID:
description: Target run id
default: ${{ github.run_id }}
required: true
required: false
SET_ENV_NAME:
description: Env name
required: false
Expand All @@ -21,6 +21,10 @@ inputs:
description: Fallback conclusion
required: false
default: skipped
STRICT_SUCCESS:
description: Whether to report as success only if all jobs are successful
required: false
default: "false"

outputs:
conclusion:
Expand All @@ -31,5 +35,5 @@ branding:
color: 'green'

runs:
using: node12
using: node16
main: lib/main.js
13 changes: 0 additions & 13 deletions jest.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions jest.setup.ts

This file was deleted.

64 changes: 34 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@technote-space/workflow-conclusion-action",
"version": "2.2.2",
"version": "3.0.0",
"description": "GitHub action to get workflow conclusion.",
"keywords": [
"github",
Expand All @@ -25,43 +25,47 @@
"action.yml"
],
"scripts": {
"build": "tsc",
"cover": "jest --coverage",
"build": "rm -rdf lib && rollup -c",
"cover": "vitest run --coverage",
"postinstall": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/husky ] || husky install",
"lint": "eslint 'src/**/*.ts' '__tests__/**/*.ts' --cache",
"lint:fix": "eslint --fix 'src/**/*.ts' '__tests__/**/*.ts'",
"lint": "eslint 'src/**/*.ts' --cache",
"lint:fix": "eslint --fix 'src/**/*.ts'",
"prepublishOnly": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/pinst ] || pinst --disable",
"postpublish": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/pinst ] || pinst --enable",
"release": "yarn release-ga --test",
"test": "yarn lint && yarn cover",
"test": "yarn lint && yarn typecheck && yarn cover",
"typecheck": "tsc --noEmit",
"update": "npm_config_yes=true npx npm-check-updates -u --timeout 100000 && yarn install && yarn upgrade && yarn audit"
},
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0",
"devDependencies": {
"@actions/core": "^1.8.2",
"@actions/github": "^5.0.3",
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@octokit/openapi-types": "^11.2.0",
"@octokit/types": "^6.34.0",
"@technote-space/github-action-helper": "^5.2.27",
"@technote-space/github-action-log-helper": "^0.1.46"
},
"devDependencies": {
"@commitlint/cli": "^16.0.1",
"@commitlint/config-conventional": "^16.0.0",
"@technote-space/github-action-test-helper": "^0.7.35",
"@technote-space/release-github-actions-cli": "^1.8.8",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.7",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"eslint": "^8.6.0",
"husky": "^7.0.4",
"jest": "^27.4.5",
"jest-circus": "^27.4.5",
"lint-staged": "^12.1.5",
"nock": "^13.2.1",
"pinst": "^2.1.6",
"ts-jest": "^27.1.2",
"typescript": "^4.5.4"
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-typescript": "^8.3.2",
"@sindresorhus/tsconfig": "^3.0.1",
"@technote-space/github-action-helper": "^5.3.7",
"@technote-space/github-action-log-helper": "^0.2.5",
"@technote-space/github-action-test-helper": "^0.9.7",
"@technote-space/release-github-actions-cli": "^1.9.0",
"@types/node": "^17.0.38",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"c8": "^7.11.3",
"eslint": "^8.16.0",
"eslint-plugin-import": "^2.26.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.0",
"nock": "^13.2.4",
"pinst": "^3.0.0",
"rollup": "^2.75.5",
"typescript": "^4.7.2",
"vitest": "^0.13.1"
},
"publishConfig": {
"access": "public"
Expand Down
18 changes: 18 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pluginCommonjs from '@rollup/plugin-commonjs';
import pluginJson from '@rollup/plugin-json';
import pluginNodeResolve from '@rollup/plugin-node-resolve';
import pluginTypescript from '@rollup/plugin-typescript';

export default {
input: 'src/main.ts',
output: {
file: 'lib/main.js',
format: 'cjs',
},
plugins: [
pluginTypescript(),
pluginNodeResolve(),
pluginCommonjs(),
pluginJson(),
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496",
"html_url": "https://github.com/octo-org/octo-repo/runs/399444496",
"status": "completed",
"conclusion": "failure",
"conclusion": null,
"started_at": "2020-01-20T17:42:40Z",
"completed_at": "2020-01-20T17:44:39Z",
"name": "build",
Expand Down
12 changes: 6 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {resolve} from 'path';
import {setFailed} from '@actions/core';
import {Context} from '@actions/github/lib/context';
import {ContextHelper, Utils} from '@technote-space/github-action-helper';
import {Logger} from '@technote-space/github-action-log-helper';
import {execute} from './process';
import { resolve } from 'path';
import { setFailed } from '@actions/core';
import { Context } from '@actions/github/lib/context';
import { ContextHelper, Utils } from '@technote-space/github-action-helper';
import { Logger } from '@technote-space/github-action-log-helper';
import { execute } from './process';

const run = async(): Promise<void> => {
const logger = new Logger();
Expand Down

0 comments on commit 3ac32f3

Please sign in to comment.