Compare commits

..

41 Commits
v9.1.4 ... main

Author SHA1 Message Date
dependabot[bot]
5442017c90 chore(deps-dev): bump eslint-config-prettier from 10.0.2 to 10.1.1 (#680)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 10.0.2 to 10.1.1.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v10.0.2...v10.1.1)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 14:51:23 +01:00
dependabot[bot]
b66b3d957b chore(deps-dev): bump typescript from 5.7.3 to 5.8.2 (#679)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.3 to 5.8.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.3...v5.8.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 14:55:43 +00:00
dependabot[bot]
c429775801 chore(deps-dev): bump eslint-config-prettier from 10.0.1 to 10.0.2 (#678)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 10.0.1 to 10.0.2.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v10.0.1...v10.0.2)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 14:53:46 +00:00
Federico Grandi
a7248cba33 ci: add dependency review workflow 2025-03-04 15:48:09 +01:00
dependabot[bot]
7e6142f958 chore(deps-dev): bump eslint-config-prettier from 9.1.0 to 10.0.1 (#677)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 9.1.0 to 10.0.1.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v9.1.0...v10.0.1)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-09 20:19:16 +01:00
dependabot[bot]
a604fba70a chore(deps-dev): bump typescript from 5.7.2 to 5.7.3 (#676)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.2...v5.7.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 16:31:48 +01:00
Federico Grandi
af39be1177 chore: delete CODE_OF_CONDUCT.md 2025-01-01 20:10:39 +01:00
dependabot[bot]
1ce4061cf9 chore(deps-dev): bump typescript from 5.6.3 to 5.7.2 (#671)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.6.3 to 5.7.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.3...v5.7.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-15 18:27:00 +00:00
dependabot[bot]
889be58c4d chore(deps-dev): bump husky from 9.1.6 to 9.1.7 (#672)
Bumps [husky](https://github.com/typicode/husky) from 9.1.6 to 9.1.7.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v9.1.6...v9.1.7)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-15 18:25:06 +00:00
allcontributors[bot]
2afad56181 docs: add icemac as a contributor for doc (#674)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-11-26 22:37:03 +00:00
Federico Grandi
b27b48143f docs: mention persist-credentials
Closes #673
2024-11-26 23:35:49 +01:00
dependabot[bot]
8c5cdcb4e6 chore(deps): bump cross-spawn (#670)
Bumps  and [cross-spawn](https://github.com/moxystudio/node-cross-spawn). These dependencies needed to be updated together.

Updates `cross-spawn` from 6.0.5 to 7.0.6
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v7.0.6)

Updates `cross-spawn` from 7.0.3 to 7.0.6
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-21 18:51:47 +01:00
dependabot[bot]
1c4372c149 chore(deps-dev): bump @vercel/ncc from 0.38.2 to 0.38.3 (#669)
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.2 to 0.38.3.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.2...0.38.3)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 19:49:57 +01:00
dependabot[bot]
43eaafb140 chore(deps-dev): bump gts from 6.0.0 to 6.0.2 (#666)
Bumps [gts](https://github.com/google/gts) from 6.0.0 to 6.0.2.
- [Release notes](https://github.com/google/gts/releases)
- [Changelog](https://github.com/google/gts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/gts/compare/v6.0.0...v6.0.2)

---
updated-dependencies:
- dependency-name: gts
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 20:02:56 +01:00
dependabot[bot]
8190631d94 chore(deps-dev): bump gts from 5.3.1 to 6.0.0 (#665)
Bumps [gts](https://github.com/google/gts) from 5.3.1 to 6.0.0.
- [Release notes](https://github.com/google/gts/releases)
- [Changelog](https://github.com/google/gts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/gts/compare/v5.3.1...v6.0.0)

---
updated-dependencies:
- dependency-name: gts
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-24 10:58:48 +00:00
dependabot[bot]
6e5b99c8db chore(deps-dev): bump typescript from 5.6.2 to 5.6.3 (#664)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.6.2 to 5.6.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.2...v5.6.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 10:56:48 +02:00
dependabot[bot]
84999ce9ea chore(deps): bump @actions/core from 1.10.1 to 1.11.1 (#663)
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.1 to 1.11.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 15:25:42 +02:00
dependabot[bot]
8935e603ca chore(deps-dev): bump @vercel/ncc from 0.38.1 to 0.38.2 (#662)
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.1 to 0.38.2.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.1...0.38.2)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 18:36:27 +02:00
dependabot[bot]
527320ea2d chore(deps-dev): bump typescript from 5.5.4 to 5.6.2 (#661)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.5.4 to 5.6.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.5.4...v5.6.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 20:14:12 +02:00
dependabot[bot]
687728dbe0 chore(deps-dev): bump husky from 9.1.5 to 9.1.6 (#660)
Bumps [husky](https://github.com/typicode/husky) from 9.1.5 to 9.1.6.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v9.1.5...v9.1.6)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 19:37:07 +02:00
dependabot[bot]
1ec3a804a1 chore(deps-dev): bump husky from 9.1.4 to 9.1.5 (#659)
Bumps [husky](https://github.com/typicode/husky) from 9.1.4 to 9.1.5.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v9.1.4...v9.1.5)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 10:51:04 +02:00
dependabot[bot]
b3200cb7c0 chore(deps-dev): bump husky from 9.1.1 to 9.1.4 (#655)
Bumps [husky](https://github.com/typicode/husky) from 9.1.1 to 9.1.4.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v9.1.1...v9.1.4)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-01 11:08:52 +02:00
dependabot[bot]
d8fab77eeb chore(deps-dev): bump typescript from 5.5.3 to 5.5.4 (#653)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.5.3 to 5.5.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.3...v5.5.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-01 11:04:41 +02:00
dependabot[bot]
51b363887c chore(deps-dev): bump husky from 9.0.11 to 9.1.1 (#650)
Bumps [husky](https://github.com/typicode/husky) from 9.0.11 to 9.1.1.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v9.0.11...v9.1.1)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 22:51:40 +02:00
allcontributors[bot]
c73ef84c93 docs: add tommie as a contributor for doc (#647)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-07-19 09:41:34 +00:00
Federico Grandi
24d00e1cb3 chore: update .all-contributorsrc 2024-07-19 11:40:36 +02:00
dependabot[bot]
7703ecae46 chore(deps-dev): bump typescript from 5.5.2 to 5.5.3 (#649)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.5.2 to 5.5.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.2...v5.5.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-11 12:11:46 +02:00
tommie
ccb0550b1f docs: add examples of input arrays. (#645)
Having to wrap it all as a string is a bit strange, and an example helps.

I don't actually think the `JSON.parse` is needed, because the YAML flow sequence syntax handles that case too: https://yaml.org/spec/1.2.2/#741-flow-sequences
2024-06-28 16:52:59 +02:00
dependabot[bot]
a82018e6f9 chore(deps-dev): bump typescript from 5.4.5 to 5.5.2 (#644)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.5 to 5.5.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.5...v5.5.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 02:28:23 +02:00
dependabot[bot]
c2d3f65199 chore(deps-dev): bump braces from 3.0.2 to 3.0.3 (#641)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-20 09:57:45 +00:00
dependabot[bot]
301be1ffff chore(deps-dev): bump gts from 5.3.0 to 5.3.1 (#642)
Bumps [gts](https://github.com/google/gts) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/google/gts/releases)
- [Changelog](https://github.com/google/gts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/gts/compare/v5.3.0...v5.3.1)

---
updated-dependencies:
- dependency-name: gts
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-20 11:55:45 +02:00
dependabot[bot]
61a466846d chore(deps-dev): bump typescript from 5.2.2 to 5.4.5 (#639)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.2.2 to 5.4.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.2.2...v5.4.5)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 17:34:55 +02:00
dependabot[bot]
38ab09c7b0 chore(deps-dev): bump gts from 5.2.0 to 5.3.0 (#637)
Bumps [gts](https://github.com/google/gts) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/google/gts/releases)
- [Changelog](https://github.com/google/gts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/gts/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: gts
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 10:44:29 +02:00
Federico Grandi
cb9365b122 chore: switch to GTS for linting (#636)
* fix: switch over to gts

* fix: add debug message for input arrays

* fix: fix input array parsing
2024-03-26 14:41:25 +01:00
dependabot[bot]
95ee72e80d chore(deps-dev): bump husky from 9.0.6 to 9.0.11 (#626)
Bumps [husky](https://github.com/typicode/husky) from 9.0.6 to 9.0.11.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v9.0.6...v9.0.11)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 19:48:47 +01:00
Federico Grandi
c2fbb34d0e chore: remove CodeSee integration
CodeSee is shutting down: https://www.linkedin.com/posts/shaneak_i-am-very-sad-to-announce-officially-activity-7163970333912289281-DaOb
2024-02-18 00:09:53 +00:00
dependabot[bot]
51ec2d069c chore(deps-dev): bump @typescript-eslint/parser from 6.19.1 to 6.21.0 (#624)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.19.1 to 6.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.21.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 22:40:22 +01:00
dependabot[bot]
6d52f935af chore(deps-dev): bump @typescript-eslint/eslint-plugin (#623)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.19.1 to 6.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.21.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 15:55:54 +01:00
dependabot[bot]
6ad98b93ec chore(deps-dev): bump prettier from 3.2.4 to 3.2.5 (#619)
Bumps [prettier](https://github.com/prettier/prettier) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.2.4...3.2.5)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 15:31:11 +01:00
dependabot[bot]
8781a821ec chore(deps-dev): bump @typescript-eslint/parser from 6.19.0 to 6.19.1 (#618)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.19.0 to 6.19.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.19.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 11:18:37 +01:00
dependabot[bot]
813dfa4ef4 chore(deps-dev): bump husky from 8.0.3 to 9.0.6 (#617)
* chore(deps-dev): bump husky from 8.0.3 to 9.0.6

Bumps [husky](https://github.com/typicode/husky) from 8.0.3 to 9.0.6.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v8.0.3...v9.0.6)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: migrate husky to v9

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Federico Grandi <fgrandi30@gmail.com>
2024-02-02 11:17:28 +01:00
20 changed files with 2366 additions and 1817 deletions

View File

@@ -515,9 +515,27 @@
"contributions": [
"maintenance"
]
},
{
"login": "tommie",
"name": "tommie",
"avatar_url": "https://avatars.githubusercontent.com/u/216382?v=4",
"profile": "https://github.com/tommie",
"contributions": [
"doc"
]
},
{
"login": "icemac",
"name": "Michael Howitz",
"avatar_url": "https://avatars.githubusercontent.com/u/386619?v=4",
"profile": "https://minddistrict.de",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
"skipCi": true,
"skipCi": false,
"commitType": "docs"
}

8
.editorconfig Normal file
View File

@@ -0,0 +1,8 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true

1
.eslintignore Normal file
View File

@@ -0,0 +1 @@
lib/

View File

@@ -1,36 +0,0 @@
module.exports = {
env: {
commonjs: true,
es6: true,
node: true
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
globals: {},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
ignorePatterns: ['lib/*'],
rules: {
'prettier/prettier': 'warn',
'no-cond-assign': [2, 'except-parens'],
'no-unused-vars': 0,
'no-redeclare': 0,
'@typescript-eslint/no-unused-vars': 1,
'no-empty': [
'error',
{
allowEmptyCatch: true
}
],
'prefer-const': [
'warn',
{
destructuring: 'all'
}
],
'spaced-comment': 'warn'
}
}

3
.eslintrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts/"
}

View File

@@ -1,22 +0,0 @@
# This workflow was added by CodeSee. Learn more at https://codesee.io/
# This is v2.0 of this workflow file
on:
push:
branches:
- main
pull_request_target:
types: [opened, synchronize, reopened]
name: CodeSee
permissions: read-all
jobs:
codesee:
runs-on: ubuntu-latest
continue-on-error: true
name: Analyze the repo with CodeSee
steps:
- uses: Codesee-io/codesee-action@v2
with:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}

14
.github/workflows/dependency-review.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: 'Dependency Review'
on: [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4

View File

@@ -7,7 +7,7 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
@@ -18,7 +18,7 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

View File

@@ -1,5 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm run build
git add lib

View File

@@ -1,7 +0,0 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "none"
}

3
.prettierrc.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
...require('gts/.prettierrc.json'),
};

View File

@@ -1,128 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
fgrandi30@gmail.com.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@@ -206,6 +206,8 @@ Some users reported that they were getting an error:
If you're getting this error and you're using `actions/checkout@v1`, try upgrading to `actions/checkout@v2`. If you're still having problems after upgrading, feel free to open an issue. Issue ref: [#146](https://github.com/EndBug/add-and-commit/issues/146)
Please note that using `persist-credentials: false` will lead to the same issue.
### Performance on large repos
By default, the action will fetch the repository before starting to work on it: this ensures that it can see the already existing refs.
@@ -255,6 +257,29 @@ You can also use the `committer_name` and `committer_email` inputs to make it ap
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
```
### Array inputs
Due to limitations in the GitHub action APIs, all inputs must be either strings or booleans.
The action supports arrays in `add` and `remove`, but they have to be encoded as a string with a YAML flow sequence:
```yaml
- uses: EndBug/add-and-commit@v9
with:
add: '["afile.txt", "anotherfile.txt"]'
```
(note the single-quotes) or a YAML block sequence:
```yaml
- uses: EndBug/add-and-commit@v9
with:
add: |
- afile.txt
- anotherfile.txt
```
(Note the pipe character making it a multiline string.)
### Automated linting
Do you want to lint your JavaScript files, located in the `src` folder, with ESLint, so that fixable changes are done without your intervention? You can use a workflow like this:
@@ -403,6 +428,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://cderv.rbind.io"><img src="https://avatars.githubusercontent.com/u/6791940?v=4?s=100" width="100px;" alt="Christophe Dervieux"/><br /><sub><b>Christophe Dervieux</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=cderv" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/deining"><img src="https://avatars.githubusercontent.com/u/18169566?v=4?s=100" width="100px;" alt="Andreas Deininger"/><br /><sub><b>Andreas Deininger</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=deining" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://droettboom.com"><img src="https://avatars.githubusercontent.com/u/38294?v=4?s=100" width="100px;" alt="Michael Droettboom"/><br /><sub><b>Michael Droettboom</b></sub></a><br /><a href="#maintenance-mdboom" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tommie"><img src="https://avatars.githubusercontent.com/u/216382?v=4?s=100" width="100px;" alt="tommie"/><br /><sub><b>tommie</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=tommie" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://minddistrict.de"><img src="https://avatars.githubusercontent.com/u/386619?v=4?s=100" width="100px;" alt="Michael Howitz"/><br /><sub><b>Michael Howitz</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=icemac" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>

4
lib/index.js generated

File diff suppressed because one or more lines are too long

3185
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,15 +5,18 @@
"description": "Add & commit files from a path directly from GitHub Actions",
"main": "lib/index.js",
"scripts": {
"prebuild": "npm run clean",
"build": "ncc build src/main.ts --minify --out lib",
"watch": "ncc build src/main.ts --watch --out lib",
"lint": "eslint --ext .ts src",
"lint:fix": "eslint --ext .ts --fix src",
"prepare": "husky install",
"test": "echo \"Error: no test specified\" && exit 1"
"lint": "gts lint",
"prepare": "husky",
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "gts clean",
"fix": "gts fix",
"pretest": "npm run compile",
"posttest": "npm run lint"
},
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/core": "^1.11.1",
"actions-toolkit": "github:EndBug/actions-toolkit#core-actions",
"js-yaml": "^4.1.0",
"simple-git": "^3.18.0",
@@ -21,17 +24,13 @@
},
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.11.6",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.0",
"@vercel/ncc": "^0.38.1",
"@types/node": "20.8.2",
"@vercel/ncc": "^0.38.3",
"all-contributors-cli": "^6.26.1",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^8.0.3",
"prettier": "^3.2.4",
"typescript": "^5.3.3"
"eslint-config-prettier": "^10.1.1",
"gts": "^6.0.2",
"husky": "^9.1.7",
"typescript": "~5.8.2"
},
"engines": {
"node": ">=20"

246
src/io.ts
View File

@@ -1,38 +1,38 @@
import * as core from '@actions/core'
import { getUserInfo, parseInputArray } from './util'
import * as core from '@actions/core';
import {getUserInfo, parseInputArray} from './util';
interface InputTypes {
add: string
author_name: string
author_email: string
commit: string | undefined
committer_name: string
committer_email: string
cwd: string
default_author: 'github_actor' | 'user_info' | 'github_actions'
fetch: string
message: string
new_branch: string | undefined
pathspec_error_handling: 'ignore' | 'exitImmediately' | 'exitAtEnd'
pull: string | undefined
push: string
remove: string | undefined
tag: string | undefined
tag_push: string | undefined
export interface InputTypes {
add: string;
author_name: string;
author_email: string;
commit: string | undefined;
committer_name: string;
committer_email: string;
cwd: string;
default_author: 'github_actor' | 'user_info' | 'github_actions';
fetch: string;
message: string;
new_branch: string | undefined;
pathspec_error_handling: 'ignore' | 'exitImmediately' | 'exitAtEnd';
pull: string | undefined;
push: string;
remove: string | undefined;
tag: string | undefined;
tag_push: string | undefined;
github_token: string | undefined
github_token: string | undefined;
}
export type input = keyof InputTypes
export type input = keyof InputTypes;
interface OutputTypes {
committed: 'true' | 'false'
commit_long_sha: string | undefined
commit_sha: string | undefined
pushed: 'true' | 'false'
tagged: 'true' | 'false'
tag_pushed: 'true' | 'false'
export interface OutputTypes {
committed: 'true' | 'false';
commit_long_sha: string | undefined;
commit_sha: string | undefined;
pushed: 'true' | 'false';
tagged: 'true' | 'false';
tag_pushed: 'true' | 'false';
}
export type output = keyof OutputTypes
export type output = keyof OutputTypes;
export const outputs: OutputTypes = {
committed: 'false',
@@ -40,153 +40,157 @@ export const outputs: OutputTypes = {
commit_sha: undefined,
pushed: 'false',
tagged: 'false',
tag_pushed: 'false'
}
tag_pushed: 'false',
};
// Setup default output values
Object.entries(outputs).forEach(([name, value]) => core.setOutput(name, value))
Object.entries(outputs).forEach(([name, value]) => core.setOutput(name, value));
export function getInput<T extends input>(name: T, parseAsBool: true): boolean
export function getInput<T extends input>(name: T, parseAsBool: true): boolean;
export function getInput<T extends input>(
name: T,
parseAsBool?: false
): InputTypes[T]
parseAsBool?: false,
): InputTypes[T];
export function getInput<T extends input>(
name: T,
parseAsBool = false
parseAsBool = false,
): InputTypes[T] | boolean {
if (parseAsBool) return core.getBooleanInput(name)
// @ts-expect-error
return core.getInput(name)
if (parseAsBool) return core.getBooleanInput(name);
return core.getInput(name) as InputTypes[T];
}
export function setOutput<T extends output>(name: T, value: OutputTypes[T]) {
core.debug(`Setting output: ${name}=${value}`)
outputs[name] = value
core.setOutput(name, value)
core.debug(`Setting output: ${name}=${value}`);
outputs[name] = value;
core.setOutput(name, value);
}
export function logOutputs() {
core.startGroup('Outputs')
core.startGroup('Outputs');
for (const key in outputs) {
core.info(`${key}: ${outputs[key]}`)
core.info(`${key}: ${outputs[key as keyof OutputTypes]}`);
}
core.endGroup()
core.endGroup();
}
export async function checkInputs() {
function setInput(input: input, value: string | undefined) {
if (value) return (process.env[`INPUT_${input.toUpperCase()}`] = value)
else return delete process.env[`INPUT_${input.toUpperCase()}`]
if (value) return (process.env[`INPUT_${input.toUpperCase()}`] = value);
else return delete process.env[`INPUT_${input.toUpperCase()}`];
}
function setDefault(input: input, value: string) {
if (!getInput(input)) setInput(input, value)
return getInput(input)
if (!getInput(input)) setInput(input, value);
return getInput(input);
}
// #region add, remove
if (!getInput('add') && !getInput('remove'))
throw new Error(
"Both 'add' and 'remove' are empty, the action has nothing to do."
)
"Both 'add' and 'remove' are empty, the action has nothing to do.",
);
if (getInput('add')) {
const parsed = parseInputArray(getInput('add'))
if (parsed.length == 1)
core.info('Add input parsed as single string, running 1 git add command.')
const parsed = parseInputArray(getInput('add'));
if (parsed.length === 1)
core.info(
'Add input parsed as single string, running 1 git add command.',
);
else if (parsed.length > 1)
core.info(
`Add input parsed as string array, running ${parsed.length} git add commands.`
)
else core.setFailed('Add input: array length < 1')
`Add input parsed as string array, running ${parsed.length} git add commands.`,
);
else core.setFailed('Add input: array length < 1');
}
if (getInput('remove')) {
const parsed = parseInputArray(getInput('remove') || '')
if (parsed.length == 1)
const parsed = parseInputArray(getInput('remove') || '');
if (parsed.length === 1)
core.info(
'Remove input parsed as single string, running 1 git rm command.'
)
'Remove input parsed as single string, running 1 git rm command.',
);
else if (parsed.length > 1)
core.info(
`Remove input parsed as string array, running ${parsed.length} git rm commands.`
)
else core.setFailed('Remove input: array length < 1')
`Remove input parsed as string array, running ${parsed.length} git rm commands.`,
);
else core.setFailed('Remove input: array length < 1');
}
// #endregion
// #region default_author
const default_author_valid = ['github_actor', 'user_info', 'github_actions']
const default_author_valid = ['github_actor', 'user_info', 'github_actions'];
if (!default_author_valid.includes(getInput('default_author')))
throw new Error(
`'${getInput(
'default_author'
'default_author',
)}' is not a valid value for default_author. Valid values: ${default_author_valid.join(
', '
)}`
)
', ',
)}`,
);
// #endregion
// #region fetch
if (getInput('fetch')) {
let value: string | boolean
let value: string | boolean;
try {
value = getInput('fetch', true)
value = getInput('fetch', true);
} catch {
value = getInput('fetch')
value = getInput('fetch');
}
core.debug(`Current fetch option: '${value}' (parsed as ${typeof value})`)
core.debug(`Current fetch option: '${value}' (parsed as ${typeof value})`);
}
// #endregion
// #region author_name, author_email
let name, email
let name, email;
switch (getInput('default_author')) {
case 'github_actor': {
name = process.env.GITHUB_ACTOR
email = `${process.env.GITHUB_ACTOR}@users.noreply.github.com`
break
name = process.env.GITHUB_ACTOR ?? '';
email = `${process.env.GITHUB_ACTOR}@users.noreply.github.com`;
break;
}
case 'user_info': {
if (!getInput('author_name') || !getInput('author_email')) {
const res = await getUserInfo(process.env.GITHUB_ACTOR)
const res = await getUserInfo(process.env.GITHUB_ACTOR);
if (!res?.name)
core.warning("Couldn't fetch author name, filling with github_actor.")
core.warning(
"Couldn't fetch author name, filling with github_actor.",
);
if (!res?.email)
core.warning(
"Couldn't fetch author email, filling with github_actor."
)
"Couldn't fetch author email, filling with github_actor.",
);
res?.name && (name = res?.name)
res?.email && (email = res.email)
if (name && email) break
res?.name && (name = res?.name);
res?.email && (email = res.email);
if (name && email) break;
}
!name && (name = process.env.GITHUB_ACTOR)
!email && (email = `${process.env.GITHUB_ACTOR}@users.noreply.github.com`)
break
!name && (name = process.env.GITHUB_ACTOR ?? '');
!email &&
(email = `${process.env.GITHUB_ACTOR}@users.noreply.github.com`);
break;
}
case 'github_actions': {
name = 'github-actions'
email = '41898282+github-actions[bot]@users.noreply.github.com'
break
name = 'github-actions';
email = '41898282+github-actions[bot]@users.noreply.github.com';
break;
}
default:
throw new Error(
'This should not happen, please contact the author of this action. (checkInputs.author)'
)
'This should not happen, please contact the author of this action. (checkInputs.author)',
);
}
setDefault('author_name', name)
setDefault('author_email', email)
setDefault('author_name', name);
setDefault('author_email', email);
core.info(
`> Using '${getInput('author_name')} <${getInput(
'author_email'
)}>' as author.`
)
'author_email',
)}>' as author.`,
);
// #endregion
// #region committer_name, committer_email
@@ -198,62 +202,62 @@ export async function checkInputs() {
} <${
getInput('committer_email') ||
getInput('author_email') + ' [from author info]'
}>`
)
}>`,
);
setDefault('committer_name', getInput('author_name'))
setDefault('committer_email', getInput('author_email'))
setDefault('committer_name', getInput('author_name'));
setDefault('committer_email', getInput('author_email'));
core.debug(
`Committer: ${getInput('committer_name')} <${getInput('committer_email')}>`
)
`Committer: ${getInput('committer_name')} <${getInput('committer_email')}>`,
);
// #endregion
// #region message
setDefault(
'message',
`Commit from GitHub Actions (${process.env.GITHUB_WORKFLOW})`
)
core.info(`> Using "${getInput('message')}" as commit message.`)
`Commit from GitHub Actions (${process.env.GITHUB_WORKFLOW})`,
);
core.info(`> Using "${getInput('message')}" as commit message.`);
// #endregion
// #region pathspec_error_handling
const peh_valid = ['ignore', 'exitImmediately', 'exitAtEnd']
const peh_valid = ['ignore', 'exitImmediately', 'exitAtEnd'];
if (!peh_valid.includes(getInput('pathspec_error_handling')))
throw new Error(
`"${getInput(
'pathspec_error_handling'
'pathspec_error_handling',
)}" is not a valid value for the 'pathspec_error_handling' input. Valid values are: ${peh_valid.join(
', '
)}`
)
', ',
)}`,
);
// #endregion
// #region pull
if (getInput('pull') == 'NO-PULL')
if (getInput('pull') === 'NO-PULL')
core.warning(
"`NO-PULL` is a legacy option for the `pull` input. If you don't want the action to pull the repo, simply remove this input."
)
"`NO-PULL` is a legacy option for the `pull` input. If you don't want the action to pull the repo, simply remove this input.",
);
// #endregion
// #region push
if (getInput('push')) {
// It has to be either 'true', 'false', or any other string (use as arguments)
let value: string | boolean
let value: string | boolean;
try {
value = getInput('push', true)
value = getInput('push', true);
} catch {
value = getInput('push')
value = getInput('push');
}
core.debug(`Current push option: '${value}' (parsed as ${typeof value})`)
core.debug(`Current push option: '${value}' (parsed as ${typeof value})`);
}
// #endregion
// #region github_token
if (!getInput('github_token'))
core.warning(
'No github_token has been detected, the action may fail if it needs to use the API'
)
'No github_token has been detected, the action may fail if it needs to use the API',
);
// #endregion
}

View File

@@ -1,47 +1,47 @@
import * as core from '@actions/core'
import path from 'path'
import simpleGit, { Response } from 'simple-git'
import { checkInputs, getInput, logOutputs, setOutput } from './io'
import { log, matchGitArgs, parseInputArray } from './util'
import * as core from '@actions/core';
import * as path from 'path';
import simpleGit, {Response} from 'simple-git';
import {checkInputs, getInput, logOutputs, setOutput} from './io';
import {log, matchGitArgs, parseInputArray} from './util';
const baseDir = path.join(process.cwd(), getInput('cwd') || '')
const git = simpleGit({ baseDir })
const baseDir = path.join(process.cwd(), getInput('cwd') || '');
const git = simpleGit({baseDir});
const exitErrors: Error[] = []
const exitErrors: Error[] = [];
core.info(`Running in ${baseDir}`)
;(async () => {
await checkInputs()
core.info(`Running in ${baseDir}`);
(async () => {
await checkInputs();
core.startGroup('Internal logs')
core.info('> Staging files...')
core.startGroup('Internal logs');
core.info('> Staging files...');
const ignoreErrors =
getInput('pathspec_error_handling') == 'ignore' ? 'pathspec' : 'none'
getInput('pathspec_error_handling') === 'ignore' ? 'pathspec' : 'none';
if (getInput('add')) {
core.info('> Adding files...')
await add(ignoreErrors)
} else core.info('> No files to add.')
core.info('> Adding files...');
await add(ignoreErrors);
} else core.info('> No files to add.');
if (getInput('remove')) {
core.info('> Removing files...')
await remove(ignoreErrors)
} else core.info('> No files to remove.')
core.info('> Removing files...');
await remove(ignoreErrors);
} else core.info('> No files to remove.');
core.info('> Checking for uncommitted changes in the git working tree...')
const changedFiles = (await git.diffSummary(['--cached'])).files.length
core.info('> Checking for uncommitted changes in the git working tree...');
const changedFiles = (await git.diffSummary(['--cached'])).files.length;
// continue if there are any changes or if the allow-empty commit argument is included
if (
changedFiles > 0 ||
matchGitArgs(getInput('commit') || '').includes('--allow-empty')
) {
core.info(`> Found ${changedFiles} changed files.`)
core.info(`> Found ${changedFiles} changed files.`);
core.debug(
`--allow-empty argument detected: ${matchGitArgs(
getInput('commit') || ''
).includes('--allow-empty')}`
)
getInput('commit') || '',
).includes('--allow-empty')}`,
);
await git
.addConfig('user.email', getInput('author_email'), undefined, log)
@@ -49,252 +49,252 @@ core.info(`Running in ${baseDir}`)
.addConfig('author.email', getInput('author_email'), undefined, log)
.addConfig('author.name', getInput('author_name'), undefined, log)
.addConfig('committer.email', getInput('committer_email'), undefined, log)
.addConfig('committer.name', getInput('committer_name'), undefined, log)
.addConfig('committer.name', getInput('committer_name'), undefined, log);
core.debug(
'> Current git config\n' +
JSON.stringify((await git.listConfig()).all, null, 2)
)
JSON.stringify((await git.listConfig()).all, null, 2),
);
let fetchOption: string | boolean
let fetchOption: string | boolean;
try {
fetchOption = getInput('fetch', true)
fetchOption = getInput('fetch', true);
} catch {
fetchOption = getInput('fetch')
fetchOption = getInput('fetch');
}
if (fetchOption) {
core.info('> Fetching repo...')
core.info('> Fetching repo...');
await git.fetch(
matchGitArgs(fetchOption === true ? '' : fetchOption),
log
)
} else core.info('> Not fetching repo.')
log,
);
} else core.info('> Not fetching repo.');
const targetBranch = getInput('new_branch')
const targetBranch = getInput('new_branch');
if (targetBranch) {
core.info('> Checking-out branch...')
core.info('> Checking-out branch...');
if (!fetchOption)
core.warning(
'Creating a new branch without fetching the repo first could result in an error when pushing to GitHub. Refer to the action README for more info about this topic.'
)
'Creating a new branch without fetching the repo first could result in an error when pushing to GitHub. Refer to the action README for more info about this topic.',
);
await git
.checkout(targetBranch)
.then(() => {
log(undefined, `'${targetBranch}' branch already existed.`)
log(undefined, `'${targetBranch}' branch already existed.`);
})
.catch(() => {
log(undefined, `Creating '${targetBranch}' branch.`)
return git.checkoutLocalBranch(targetBranch, log)
})
log(undefined, `Creating '${targetBranch}' branch.`);
return git.checkoutLocalBranch(targetBranch, log);
});
}
const pullOption = getInput('pull')
const pullOption = getInput('pull');
if (pullOption) {
core.info('> Pulling from remote...')
core.debug(`Current git pull arguments: ${pullOption}`)
core.info('> Pulling from remote...');
core.debug(`Current git pull arguments: ${pullOption}`);
await git
.fetch(undefined, log)
.pull(undefined, undefined, matchGitArgs(pullOption), log)
.pull(undefined, undefined, matchGitArgs(pullOption), log);
core.info('> Checking for conflicts...')
const status = await git.status(undefined, log)
core.info('> Checking for conflicts...');
const status = await git.status(undefined, log);
if (!status.conflicted.length) {
core.info('> No conflicts found.')
core.info('> Re-staging files...')
if (getInput('add')) await add(ignoreErrors)
if (getInput('remove')) await remove(ignoreErrors)
core.info('> No conflicts found.');
core.info('> Re-staging files...');
if (getInput('add')) await add(ignoreErrors);
if (getInput('remove')) await remove(ignoreErrors);
} else
throw new Error(
`There are ${
status.conflicted.length
} conflicting files: ${status.conflicted.join(', ')}`
)
} else core.info('> Not pulling from repo.')
} conflicting files: ${status.conflicted.join(', ')}`,
);
} else core.info('> Not pulling from repo.');
core.info('> Creating commit...')
core.info('> Creating commit...');
await git
.commit(getInput('message'), matchGitArgs(getInput('commit') || ''))
.then(async (data) => {
log(undefined, data)
setOutput('committed', 'true')
setOutput('commit_long_sha', data.commit)
setOutput('commit_sha', data.commit.substring(0, 7))
.then(async data => {
log(undefined, data);
setOutput('committed', 'true');
setOutput('commit_long_sha', data.commit);
setOutput('commit_sha', data.commit.substring(0, 7));
})
.catch((err) => core.setFailed(err))
.catch(err => core.setFailed(err));
if (getInput('tag')) {
core.info('> Tagging commit...')
core.info('> Tagging commit...');
if (!fetchOption)
core.warning(
'Creating a tag without fetching the repo first could result in an error when pushing to GitHub. Refer to the action README for more info about this topic.'
)
'Creating a tag without fetching the repo first could result in an error when pushing to GitHub. Refer to the action README for more info about this topic.',
);
await git
.tag(matchGitArgs(getInput('tag') || ''), (err, data?) => {
if (data) setOutput('tagged', 'true')
return log(err, data)
if (data) setOutput('tagged', 'true');
return log(err, data);
})
.then((data) => {
setOutput('tagged', 'true')
return log(null, data)
.then(data => {
setOutput('tagged', 'true');
return log(null, data);
})
.catch((err) => core.setFailed(err))
} else core.info('> No tag info provided.')
.catch(err => core.setFailed(err));
} else core.info('> No tag info provided.');
let pushOption: string | boolean
let pushOption: string | boolean;
try {
pushOption = getInput('push', true)
pushOption = getInput('push', true);
} catch {
pushOption = getInput('push')
pushOption = getInput('push');
}
if (pushOption) {
// If the options is `true | string`...
core.info('> Pushing commit to repo...')
core.info('> Pushing commit to repo...');
if (pushOption === true) {
core.debug(
`Running: git push origin ${
getInput('new_branch') || ''
} --set-upstream`
)
} --set-upstream`,
);
await git.push(
'origin',
getInput('new_branch'),
{ '--set-upstream': null },
{'--set-upstream': null},
(err, data?) => {
if (data) setOutput('pushed', 'true')
return log(err, data)
}
)
if (data) setOutput('pushed', 'true');
return log(err, data);
},
);
} else {
core.debug(`Running: git push ${pushOption}`)
core.debug(`Running: git push ${pushOption}`);
await git.push(
undefined,
undefined,
matchGitArgs(pushOption),
(err, data?) => {
if (data) setOutput('pushed', 'true')
return log(err, data)
}
)
if (data) setOutput('pushed', 'true');
return log(err, data);
},
);
}
if (getInput('tag')) {
core.info('> Pushing tags to repo...')
core.info('> Pushing tags to repo...');
await git
.pushTags('origin', matchGitArgs(getInput('tag_push') || ''))
.then((data) => {
setOutput('tag_pushed', 'true')
return log(null, data)
.then(data => {
setOutput('tag_pushed', 'true');
return log(null, data);
})
.catch((err) => core.setFailed(err))
} else core.info('> No tags to push.')
} else core.info('> Not pushing anything.')
.catch(err => core.setFailed(err));
} else core.info('> No tags to push.');
} else core.info('> Not pushing anything.');
core.endGroup()
core.info('> Task completed.')
core.endGroup();
core.info('> Task completed.');
} else {
core.endGroup()
core.info('> Working tree clean. Nothing to commit.')
core.endGroup();
core.info('> Working tree clean. Nothing to commit.');
}
})()
.then(() => {
// Check for exit errors
if (exitErrors.length == 1) throw exitErrors[0]
if (exitErrors.length === 1) throw exitErrors[0];
else if (exitErrors.length > 1) {
exitErrors.forEach((e) => core.error(e))
throw 'There have been multiple runtime errors.'
exitErrors.forEach(e => core.error(e));
throw 'There have been multiple runtime errors.';
}
})
.then(logOutputs)
.catch((e) => {
core.endGroup()
logOutputs()
core.setFailed(e)
})
.catch(e => {
core.endGroup();
logOutputs();
core.setFailed(e);
});
async function add(ignoreErrors: 'all' | 'pathspec' | 'none' = 'none') {
const input = getInput('add')
if (!input) return []
const input = getInput('add');
if (!input) return [];
const parsed = parseInputArray(input)
const res: (string | void)[] = []
const parsed = parseInputArray(input);
const res: (string | void)[] = [];
for (const args of parsed) {
res.push(
// Push the result of every git command (which are executed in order) to the array
// If any of them fails, the whole function will return a Promise rejection
await git
.add(matchGitArgs(args), (err: any, data?: any) =>
log(ignoreErrors == 'all' ? null : err, data)
.add(matchGitArgs(args), (err, data) =>
log(ignoreErrors === 'all' ? null : err, data),
)
.catch((e: Error) => {
// if I should ignore every error, return
if (ignoreErrors == 'all') return
if (ignoreErrors === 'all') return;
// if it's a pathspec error...
if (
e.message.includes('fatal: pathspec') &&
e.message.includes('did not match any files')
) {
if (ignoreErrors == 'pathspec') return
if (ignoreErrors === 'pathspec') return;
const peh = getInput('pathspec_error_handling'),
err = new Error(
`Add command did not match any file: git add ${args}`
)
if (peh == 'exitImmediately') throw err
if (peh == 'exitAtEnd') exitErrors.push(err)
} else throw e
})
)
`Add command did not match any file: git add ${args}`,
);
if (peh === 'exitImmediately') throw err;
if (peh === 'exitAtEnd') exitErrors.push(err);
} else throw e;
}),
);
}
return res
return res;
}
async function remove(
ignoreErrors: 'all' | 'pathspec' | 'none' = 'none'
ignoreErrors: 'all' | 'pathspec' | 'none' = 'none',
): Promise<(void | Response<void>)[]> {
const input = getInput('remove')
if (!input) return []
const input = getInput('remove');
if (!input) return [];
const parsed = parseInputArray(input)
const res: (void | Response<void>)[] = []
const parsed = parseInputArray(input);
const res: (void | Response<void>)[] = [];
for (const args of parsed) {
res.push(
// Push the result of every git command (which are executed in order) to the array
// If any of them fails, the whole function will return a Promise rejection
await git
.rm(matchGitArgs(args), (e: any, d?: any) =>
log(ignoreErrors == 'all' ? null : e, d)
.rm(matchGitArgs(args), (e, d) =>
log(ignoreErrors === 'all' ? null : e, d),
)
.catch((e: Error) => {
// if I should ignore every error, return
if (ignoreErrors == 'all') return
if (ignoreErrors === 'all') return;
// if it's a pathspec error...
if (
e.message.includes('fatal: pathspec') &&
e.message.includes('did not match any files')
) {
if (ignoreErrors == 'pathspec') return
if (ignoreErrors === 'pathspec') return;
const peh = getInput('pathspec_error_handling'),
err = new Error(
`Remove command did not match any file:\n git rm ${args}`
)
if (peh == 'exitImmediately') throw err
if (peh == 'exitAtEnd') exitErrors.push(err)
} else throw e
})
)
`Remove command did not match any file:\n git rm ${args}`,
);
if (peh === 'exitImmediately') throw err;
if (peh === 'exitAtEnd') exitErrors.push(err);
} else throw e;
}),
);
}
return res
return res;
}

View File

@@ -1,42 +1,43 @@
import { parseArgsStringToArgv } from 'string-argv'
import * as core from '@actions/core'
import YAML from 'js-yaml'
import { Toolkit } from 'actions-toolkit'
import fs from 'fs'
import { input, output } from './io'
import {parseArgsStringToArgv} from 'string-argv';
import * as core from '@actions/core';
import * as YAML from 'js-yaml';
import {Toolkit} from 'actions-toolkit';
import * as fs from 'fs';
import {input, output} from './io';
type RecordOf<T extends string> = Record<T, string | undefined>
type RecordOf<T extends string> = Record<T, string | undefined>;
export const tools = new Toolkit<RecordOf<input>, RecordOf<output>>({
secrets: [
'GITHUB_EVENT_PATH',
'GITHUB_EVENT_NAME',
'GITHUB_REF',
'GITHUB_ACTOR'
]
})
'GITHUB_ACTOR',
],
});
export async function getUserInfo(username?: string) {
if (!username) return undefined
if (!username) return undefined;
const res = await tools.github.users.getByUsername({ username })
const res = await tools.github.users.getByUsername({username});
core.debug(
`Fetched github actor from the API: ${JSON.stringify(res?.data, null, 2)}`
)
`Fetched github actor from the API: ${JSON.stringify(res?.data, null, 2)}`,
);
return {
name: res?.data?.name,
email: res?.data?.email
}
email: res?.data?.email,
};
}
export function log(err: any | Error, data?: any) {
if (data) console.log(data)
if (err) core.error(err)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function log(err: any, data?: any) {
if (data) console.log(data);
if (err) core.error(err);
}
/**
* Matches the given string to an array of arguments.
* Matches the given string to an array of arguments.
* The parsing is made by `string-argv`: if your way of using argument is not supported, the issue is theirs!
* {@link https://www.npm.im/string-argv}
* @example
@@ -61,11 +62,11 @@ export function log(err: any | Error, data?: any) {
* @returns An array, if there's no match it'll be empty
*/
export function matchGitArgs(string: string) {
const parsed = parseArgsStringToArgv(string)
const parsed = parseArgsStringToArgv(string);
core.debug(`Git args parsed:
- Original: ${string}
- Parsed: ${JSON.stringify(parsed)}`)
return parsed
- Parsed: ${JSON.stringify(parsed)}`);
return parsed;
}
/**
@@ -73,45 +74,38 @@ export function matchGitArgs(string: string) {
* If both fail, it returns an array containing the input value as its only element
*/
export function parseInputArray(input: string): string[] {
core.debug(`Parsing input array: ${input}`);
try {
const json = JSON.parse(input)
if (
json &&
Array.isArray(json) &&
json.every((e) => typeof e == 'string')
) {
core.debug(`Input parsed as JSON array of length ${json.length}`)
return json
const json = JSON.parse(input);
if (json && Array.isArray(json) && json.every(e => typeof e === 'string')) {
core.debug(`Input parsed as JSON array of length ${json.length}`);
return json;
}
} catch {}
} catch {} // eslint-disable-line no-empty
try {
const yaml = YAML.load(input)
if (
yaml &&
Array.isArray(yaml) &&
yaml.every((e) => typeof e == 'string')
) {
core.debug(`Input parsed as YAML array of length ${yaml.length}`)
return yaml
const yaml = YAML.load(input);
if (yaml && Array.isArray(yaml) && yaml.every(e => typeof e === 'string')) {
core.debug(`Input parsed as YAML array of length ${yaml.length}`);
return yaml;
}
} catch {}
} catch {} // eslint-disable-line no-empty
core.debug('Input parsed as single string')
return [input]
core.debug('Input parsed as single string');
return [input];
}
export function readJSON(filePath: string) {
let fileContent: string
let fileContent: string;
try {
fileContent = fs.readFileSync(filePath, { encoding: 'utf8' })
fileContent = fs.readFileSync(filePath, {encoding: 'utf8'});
} catch {
throw `Couldn't read file. File path: ${filePath}`
throw `Couldn't read file. File path: ${filePath}`;
}
try {
return JSON.parse(fileContent)
return JSON.parse(fileContent);
} catch {
throw `Couldn't parse file to JSON. File path: ${filePath}`
throw `Couldn't parse file to JSON. File path: ${filePath}`;
}
}

View File

@@ -1,62 +1,13 @@
{
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": {
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"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'. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./build", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
"rootDir": "./src",
"outDir": "./lib",
"composite": false,
"declaration": false
},
"exclude": [
"node_modules",
"**/*.test.ts",
"scripts"
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}