Skip to content

Commit

Permalink
Fix pre-commit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriziovitale committed Dec 23, 2024
1 parent cc63a1c commit 172045b
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/actions/dispatch-resume-workflow/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ module.exports = {
'@typescript-eslint/quotes': ['error', 'single'],

'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': ['error']
'@typescript-eslint/comma-spacing': ['error']
}
};
26 changes: 13 additions & 13 deletions .github/actions/dispatch-resume-workflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For details of the `workflow_dispatch` even see [this blog post introducing this

> **Required.** A GitHub access token (PAT) with write access to the repo in question.
>
> **NOTE.** The automatically provided token e.g. `${{ secrets.GITHUB_TOKEN }}` can not be used, GitHub prevents this token from being able to fire the `workflow_dispatch` and `repository_dispatch` event.[The reasons are explained in the docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token).
> **NOTE.** The automatically provided token e.g. `${{ secrets.GITHUB_TOKEN }}` can not be used, GitHub prevents this token from being able to fire the `workflow_dispatch` and `repository_dispatch` event.[The reasons are explained in the docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token).
> The solution is to manually create a PAT and store it as a secret e.g. `${{ secrets.PERSONAL_TOKEN }}`
### `inputs`
Expand Down Expand Up @@ -99,35 +99,35 @@ For details of the `workflow_dispatch` even see [this blog post introducing this
> The result of the triggered workflow. May be one of `success`, `failure`, `cancelled`, `timed_out`, `skipped`, `neutral`, `action_required`. The step in your workflow will fail if the triggered workflow completes with `failure`, `cancelled` or `timed_out`. Other workflow conlusion are considered success.
> Only available if `wait-for-completion` is `true`
### `workflow-logs`
### `output.workflow-logs`

> The logs of the triggered workflow based if `inputs.workflow-logs` is set to either `output`, or `json-output`.
> Based on the value, result will be:
>
> * `output`: Multiline string
>
> ```log
> <job-name> | <datetime> <message>
> <job-name> | <datetime> <message>
> log
> job-name | datetime message
> job-name | datetime message
> ...
> ```
>
>
> * `json-output`: JSON string
>
> ```json
> json
> {
> "<job-name>": [
> "job-name": [
> {
> "datetime": "<datetime>",
> "message": "<message>"
> "datetime": "datetime",
> "message": "message"
> },
> {
> "datetime": "<datetime>",
> "message": "<message>"
> "datetime": "datetime",
> "message": "message"
> }
> ]
> }
> ```
>
## Example usage

Expand Down
22 changes: 11 additions & 11 deletions .github/actions/dispatch-resume-workflow/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ class OidcClient {
const res = yield httpclient
.getJson(id_token_url)
.catch(error => {
throw new Error(`Failed to get ID Token. \n
Error Code : ${error.statusCode}\n
throw new Error(`Failed to get ID Token. \n
Error Code : ${error.statusCode}\n
Error Message: ${error.message}`);
});
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
Expand Down Expand Up @@ -31817,7 +31817,7 @@ module.exports = parseParams
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/
/******/ // The require function
/******/ function __nccwpck_require__(moduleId) {
/******/ // Check if module is in cache
Expand All @@ -31831,7 +31831,7 @@ module.exports = parseParams
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/
/******/ // Execute the module function
/******/ var threw = true;
/******/ try {
Expand All @@ -31840,23 +31840,23 @@ module.exports = parseParams
/******/ } finally {
/******/ if(threw) delete __webpack_module_cache__[moduleId];
/******/ }
/******/
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat */
/******/
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
/******/
/******/
/************************************************************************/
/******/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __nccwpck_require__(399);
/******/ module.exports = __webpack_exports__;
/******/
/******/
/******/ })()
;
;
12 changes: 6 additions & 6 deletions .github/actions/dispatch-resume-workflow/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"target": "es6",
"module": "commonjs",
"rootDir": "./src",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true
},
"exclude": ["node_modules", "**/*.test.ts"]
}
17 changes: 8 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ updates:
catch-all:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/.github/actions/dispatch-resume-workflow"
schedule:
interval: "weekly"
groups:
catch-all:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/.github/actions/docker-build-image"
schedule:
Expand Down Expand Up @@ -633,12 +641,3 @@ updates:
catch-all:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/.github/actions/dispatch-resume-workflow"
schedule:
interval: "weekly"
groups:
catch-all:
patterns:
- "*"
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ repos:
args: ['--fix=lf']
exclude: .github/actions/send-slack-notification/tests/sample-commit-message.txt
- id: end-of-file-fixer
exclude: '.github/actions/dispatch-resume-workflow/dist/*'
- id: trailing-whitespace
exclude: .github/actions/dispatch-resume-workflow/dist/*
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.28.5
hooks:
Expand Down
12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Here follows the list of GitHub Actions topics available in the current document
- [update-project-base-tag](#update-project-base-tag)
- [validate-maven-versions](#validate-maven-versions)
- [veracode](#veracode)
- [dispatch-resume-workflow](#dispatch-resume-workflow)
- [Reusable workflows provided by us](#reusable-workflows-provided-by-us)
- [helm-publish-new-package-version.yml](#helm-publish-new-package-versionyml)
- [terraform](#terraform)
Expand Down Expand Up @@ -1691,6 +1692,17 @@ entry `release.baseTag.$PROJECT` with the value specified in the input `tag`.
tag: ${{ env.ALPHA_VERSION }}
```

### dispatch-resume-workflow

Ability to dispatch or resume an existing workflow and wait for its completition

```yaml
- uses: Alfresco/alfresco-build-tools/.github/actions/dispatch-resume-workflow@ref
with:
workflow: workflow-name.yml
run-id: existing_run_number (optional)
```

### validate-maven-versions

Validates Maven dependency graph versions to ensure all target includes artifacts versions align
Expand Down

0 comments on commit 172045b

Please sign in to comment.