Compare commits
138 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06d54462fa | ||
|
|
21a36873cf | ||
|
|
4d2a782ca7 | ||
|
|
feb7bba5df | ||
|
|
30fd5a24e7 | ||
|
|
4f4dea335c | ||
|
|
caecee358e | ||
|
|
79fc4adbf9 | ||
|
|
4fe29d7392 | ||
|
|
2b94f96e3e | ||
|
|
ab8370c244 | ||
|
|
61eda586c3 | ||
|
|
b34850c645 | ||
|
|
f0718670ec | ||
|
|
ce9997b52f | ||
|
|
8cb387e3de | ||
|
|
4d0876f6b0 | ||
|
|
34cf82b848 | ||
|
|
8cc88cd3ac | ||
|
|
c94b5af098 | ||
|
|
d992c49843 | ||
|
|
8a80768baa | ||
|
|
8b941d4dfd | ||
|
|
d5de9f3f0d | ||
|
|
2d9c41ae6b | ||
|
|
5560eecdc1 | ||
|
|
58530b3799 | ||
|
|
026e98aa42 | ||
|
|
c2e2293f44 | ||
|
|
08fe1b6e43 | ||
|
|
46d77cfa2d | ||
|
|
8feda109a1 | ||
|
|
7e9ca065e6 | ||
|
|
7acf8aea7c | ||
|
|
30fab2fa31 | ||
|
|
cbdf3e43f1 | ||
|
|
507713a63b | ||
|
|
c512c446c5 | ||
|
|
3067c9e15c | ||
|
|
85ed07244a | ||
|
|
13550b50b0 | ||
|
|
bf3210f533 | ||
|
|
6411f389b7 | ||
|
|
dec54c038c | ||
|
|
e109cd1639 | ||
|
|
ac2b74d9d0 | ||
|
|
d82f4d33b7 | ||
|
|
d926d1c554 | ||
|
|
8b797ba126 | ||
|
|
1b11953688 | ||
|
|
36bc3f778b | ||
|
|
c61b317dea | ||
|
|
22cdfa345a | ||
|
|
d4aeb9335d | ||
|
|
46569f991f | ||
|
|
83761c7e8e | ||
|
|
f0a1d2598a | ||
|
|
c902408157 | ||
|
|
6b705fa3a4 | ||
|
|
0e98be578d | ||
|
|
c07603c1c4 | ||
|
|
9cd6e9c0ea | ||
|
|
5bf921b386 | ||
|
|
beedcea439 | ||
|
|
6cb111a771 | ||
|
|
6a4387c9c9 | ||
|
|
132aa0f637 | ||
|
|
7dbb54bce3 | ||
|
|
7f1289bf4a | ||
|
|
88d475f304 | ||
|
|
98f4b8018b | ||
|
|
2f6a78549b | ||
|
|
9cd727829f | ||
|
|
f0fcdb07a3 | ||
|
|
5ead79aef9 | ||
|
|
72da43cf1b | ||
|
|
9eb0d21b0d | ||
|
|
2db75722ce | ||
|
|
68d0f64f6f | ||
|
|
d1cfc165c7 | ||
|
|
5f12f937cb | ||
|
|
2d77fa2c79 | ||
|
|
f6b13bc7e9 | ||
|
|
116c918fd3 | ||
|
|
fbbcae9aa5 | ||
|
|
7bd2b1ca10 | ||
|
|
61d14d1bee | ||
|
|
6a75638ec3 | ||
|
|
ff38b6c4a6 | ||
|
|
e67ce7f439 | ||
|
|
a83118880c | ||
|
|
a28158a63f | ||
|
|
30030e85c0 | ||
|
|
79fa1f9f98 | ||
|
|
06fd39b8b7 | ||
|
|
f278ec6d47 | ||
|
|
5a3f4c1c24 | ||
|
|
602bf4ea71 | ||
|
|
5148cf0f38 | ||
|
|
12febc42d8 | ||
|
|
de8a121ebd | ||
|
|
a2b49385e8 | ||
|
|
ea7cddff4f | ||
|
|
9acdb7d7f4 | ||
|
|
6d08b4f153 | ||
|
|
925751a406 | ||
|
|
d3ccc660f4 | ||
|
|
4d5fbad9c9 | ||
|
|
aa1a8cef82 | ||
|
|
df80e1746f | ||
|
|
e6702dc457 | ||
|
|
08a333fd51 | ||
|
|
570c13708e | ||
|
|
6354828f7b | ||
|
|
5f0bbb3e99 | ||
|
|
a32c180667 | ||
|
|
5ba43bd1de | ||
|
|
514b397571 | ||
|
|
0a723093dc | ||
|
|
f85bf9b85e | ||
|
|
2096009ef6 | ||
|
|
8063b07a5a | ||
|
|
dd4d657304 | ||
|
|
983180c6c6 | ||
|
|
aecfd6262a | ||
|
|
b5a17167bf | ||
|
|
c3549913c6 | ||
|
|
b4fc1efdd2 | ||
|
|
01b3042145 | ||
|
|
e5272e4c09 | ||
|
|
f118062594 | ||
|
|
d81e04e96c | ||
|
|
33d0a0858a | ||
|
|
5277b29cf2 | ||
|
|
463ebc38cb | ||
|
|
b99985e9be | ||
|
|
bfb772f923 | ||
|
|
b1b499b985 |
127
.all-contributorsrc
Normal file
127
.all-contributorsrc
Normal file
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"projectName": "add-and-commit",
|
||||
"projectOwner": "EndBug",
|
||||
"repoType": "github",
|
||||
"repoHost": "https://github.com",
|
||||
"files": [
|
||||
"README.md"
|
||||
],
|
||||
"imageSize": 100,
|
||||
"commit": true,
|
||||
"commitConvention": "angular",
|
||||
"contributors": [
|
||||
{
|
||||
"login": "EndBug",
|
||||
"name": "Federico Grandi",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/26386270?v=4",
|
||||
"profile": "https://github.com/EndBug",
|
||||
"contributions": [
|
||||
"code",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jactor-rises",
|
||||
"name": "Tor Egil Jacobsen",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/14565088?v=4",
|
||||
"profile": "https://github.com/jactor-rises",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "yelizariev",
|
||||
"name": "Ivan Yelizariev",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/186131?v=4",
|
||||
"profile": "https://twitter.com/yelizariev",
|
||||
"contributions": [
|
||||
"ideas"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jhhughes",
|
||||
"name": "jhhughes",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/13724293?v=4",
|
||||
"profile": "https://github.com/jhhughes",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "DmitrijOkeanij",
|
||||
"name": "Дмитрий Океаний",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/10674646?v=4",
|
||||
"profile": "https://sunengine.site",
|
||||
"contributions": [
|
||||
"ideas"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "brahma-dev",
|
||||
"name": "Brahma Dev",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/1793295?v=4",
|
||||
"profile": "https://github.com/brahma-dev",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "felixlapalma",
|
||||
"name": "Felix Rojo Lapalma",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/38389683?v=4",
|
||||
"profile": "https://github.com/felixlapalma",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "RobinWijnant",
|
||||
"name": "Robin Wijnant",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/33033209?v=4",
|
||||
"profile": "http://robinwijnant.me",
|
||||
"contributions": [
|
||||
"bug",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "onilton",
|
||||
"name": "Onilton Maciel",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/725676?v=4",
|
||||
"profile": "https://github.com/onilton",
|
||||
"contributions": [
|
||||
"ideas"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jsoref",
|
||||
"name": "Josh Soref",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/2119212?v=4",
|
||||
"profile": "https://github.com/jsoref",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ToMe25",
|
||||
"name": "ToMe25",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/38815969?v=4",
|
||||
"profile": "https://github.com/ToMe25",
|
||||
"contributions": [
|
||||
"code",
|
||||
"ideas"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "JonasJacobsUserspace",
|
||||
"name": "JonasJacobsUserspace",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/59708720?v=4",
|
||||
"profile": "https://github.com/JonasJacobsUserspace",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
"skipCi": true
|
||||
}
|
||||
63
.eslintrc
Normal file
63
.eslintrc
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true,
|
||||
"amd": true,
|
||||
"es6": true
|
||||
},
|
||||
"root": true,
|
||||
"extends": [
|
||||
"eslint:recommended"
|
||||
],
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-cond-assign": [
|
||||
2,
|
||||
"except-parens"
|
||||
],
|
||||
"no-use-before-define": [
|
||||
2,
|
||||
{
|
||||
"functions": false,
|
||||
"classes": false,
|
||||
"variables": false
|
||||
}
|
||||
],
|
||||
"new-cap": 0,
|
||||
"no-caller": 2,
|
||||
"no-undef": 2,
|
||||
"no-unused-vars": 1,
|
||||
"no-empty": [
|
||||
"error",
|
||||
{
|
||||
"allowEmptyCatch": true
|
||||
}
|
||||
],
|
||||
"no-console": "off",
|
||||
"prefer-const": [
|
||||
"warn",
|
||||
{
|
||||
"destructuring": "all"
|
||||
}
|
||||
],
|
||||
"quotes": [
|
||||
"warn",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"warn",
|
||||
"never"
|
||||
],
|
||||
"spaced-comment": "warn"
|
||||
}
|
||||
}
|
||||
36
.github/workflows/build.yml
vendored
Normal file
36
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Build
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- dist
|
||||
paths:
|
||||
- src/**
|
||||
- .github/workflows/build.yml
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build compiled JS version
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Compile TypeScript into compressed JavaScript
|
||||
run: npm run build
|
||||
|
||||
- name: Commit changes
|
||||
uses: EndBug/add-and-commit@v4.0.0
|
||||
with:
|
||||
message: "[auto] build: update compiled version"
|
||||
add: lib
|
||||
force: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
18
.github/workflows/latest.yml
vendored
18
.github/workflows/latest.yml
vendored
@@ -1,18 +0,0 @@
|
||||
name: Add latest tag to new release
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: Add/update tag to new release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Run latest-tag
|
||||
uses: EndBug/latest-tag@latest
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
15
.github/workflows/versioning.yml
vendored
Normal file
15
.github/workflows/versioning.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Keep the versions up-to-date
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published, edited]
|
||||
|
||||
jobs:
|
||||
actions-tagger:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: Actions-R-Us/actions-tagger@v1
|
||||
with:
|
||||
publish_latest: true
|
||||
env:
|
||||
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
|
||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
build
|
||||
lib
|
||||
14
Dockerfile
14
Dockerfile
@@ -1,14 +0,0 @@
|
||||
FROM alpine/git:1.0.7
|
||||
|
||||
LABEL "com.github.actions.name"="Add & Commit"
|
||||
LABEL "com.github.actions.description"="Add & commit files from a path directly from GitHub Actions"
|
||||
LABEL "com.github.actions.icon"="git-commit"
|
||||
LABEL "com.github.actions.color"="black"
|
||||
|
||||
LABEL "repository"="https://github.com/EndBug/add-and-commit"
|
||||
LABEL "homepage"="https://github.com/EndBug/add-and-commit"
|
||||
LABEL "maintainer"="Federico Grandi <fgrandi30@gmail.com>"
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["sh", "/entrypoint.sh"]
|
||||
164
README.md
164
README.md
@@ -1,64 +1,84 @@
|
||||
# Add & Commit
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||
[](#contributors-)
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||
|
||||
You can use this GitHub Action to commit changes made in your workflow run directly to your repo: for example, you use it to lint your code, update documentation, commit updated builds and so on...
|
||||
You can use this GitHub Action to commit changes made in your workflow run directly to your repo: for example, you use it to lint your code, update documentation, commit updated builds, etc....
|
||||
|
||||
This is **heavily** inspired by [git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) (by [Stefan Zweifel](https://github.com/stefanzweifel)): that action automatically detects changed files and commits them. While this is useful for most situations, this doesn't commit untracked files and can sometimes commit unintended changes (such as `package-lock.json` or similar, that may have happened during previous steps).
|
||||
This action lets you choose the path that you want to use when adding & committing changes, so that it works as you would normally do using `git` on your machine.
|
||||
This action lets you choose the path that you want to use when adding & committing changes so that it works as you would normally do using `git` on your machine.
|
||||
|
||||
## Usage
|
||||
|
||||
Add a step like this to your workflow:
|
||||
|
||||
```yaml
|
||||
- name: Commit changes # This is the step name that will be displayed in your runs
|
||||
uses: EndBug/add-and-commit@v2.1.1 # You can change this to use a specific version
|
||||
with: # See more info about inputs below
|
||||
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
|
||||
with:
|
||||
# The arguments for the `git add` command (see the paragraph below for more info)
|
||||
# Default: '.'
|
||||
add: 'src'
|
||||
|
||||
# The name of the user that will be displayed as the author of the commit
|
||||
# Default: author of the commit that triggered the run
|
||||
author_name: Your Name
|
||||
|
||||
# The email of the user that will be displayed as the author of the commit
|
||||
# Default: author of the commit that triggered the run
|
||||
author_email: mail@example.com
|
||||
message: "Your commit message"
|
||||
path: "."
|
||||
pattern: "*.js"
|
||||
force: false
|
||||
|
||||
# The local path to the directory where your repository is located. You should use actions/checkout first to set it up
|
||||
# Default: '.'
|
||||
cwd: './path/to/the/repo'
|
||||
|
||||
# Whether to use the --force option on `git add`, in order to bypass eventual gitignores
|
||||
# Default: false
|
||||
force: true
|
||||
|
||||
# The message for the commit
|
||||
# Default: 'Commit from GitHub Actions'
|
||||
message: 'Your commit message'
|
||||
|
||||
# Name of the branch to use, if different from the one that triggered the workflow
|
||||
# Default: the branch that triggered the workflow (from GITHUB_REF)
|
||||
ref: 'someOtherBranch'
|
||||
|
||||
# The arguments for the `git rm` command (see the paragraph below for more info)
|
||||
# Default: ''
|
||||
remove: "./dir/old_file.js"
|
||||
|
||||
# Name of the tag to add to the new commit (see the paragraph below for more info)
|
||||
# Default: ''
|
||||
tag: "v1.0.0"
|
||||
|
||||
env:
|
||||
# This is necessary in order to push a commit to the repo
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
|
||||
```
|
||||
|
||||
### Inputs:
|
||||
|
||||
- `author_name` : the name of the user that will be displayed as the author of the commit
|
||||
- `author_email` : the email of the user that will be displayed as the author of the commit
|
||||
- `message` : the message for the commit
|
||||
- `path` : the path(s) to stage files from
|
||||
- `pattern` : the pattern that matches file names
|
||||
- `force` : whether to use the force option on git add, in order to bypass eventual gitignores
|
||||
|
||||
### Environment variables:
|
||||
|
||||
The only `env` variable required is the token for the action to run: GitHub generates one automatically, but you need to pass it through `env` to make it available to actions. You can find more about `GITHUB_TOKEN` [here](https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret).
|
||||
With that said, you can just copy the example line and don't worry about it. If you do want to use a different token you can pass that in, but I wouldn't see any possible advantage in doing so.
|
||||
That said, you can just copy the example line and not worry about it. If you do want to use a different token you can pass that in, but I wouldn't see any possible advantage in doing so.
|
||||
|
||||
### Adding files:
|
||||
|
||||
The action adds files using a regular `git add` command, so you can put every kind of argument in the `add` option. For example, if you don't want it to use a recursive behavior: `$(find . -maxdepth 1 -name *.js)`.
|
||||
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
|
||||
|
||||
### Deleting files:
|
||||
|
||||
This action only **adds** files so in order to commit a file deletion you need to stage that separately: for that, you can run `git rm` in a previous step. Here's a quick example:
|
||||
You can delete files with the `remove` option: that runs a `git rm` command that will stage the files in the given path for removal.
|
||||
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
|
||||
|
||||
```yaml
|
||||
- run: git rm delete_me.txt
|
||||
### Tagging:
|
||||
|
||||
- uses: EndBug/add-and-commit@v2.1.1
|
||||
with:
|
||||
author_name: Your Name
|
||||
author_email: mail@example.com
|
||||
message: "Remove file"
|
||||
path: "."
|
||||
pattern: "*.js" # The path is not important, the file will get removed anyway: that means you can still use the action as usual
|
||||
force: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
You can tag commits with the `tag` option: when used, it will create a lightweight tag for the commit with the name you set as input. If not entered (or if an empty string is passed) teh action won't create any tag.
|
||||
If there is already a tag with the name you entered it will be overwritten, and so the tag will be "updated".
|
||||
|
||||
### Example:
|
||||
### Examples:
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
```yaml
|
||||
name: Lint source code
|
||||
@@ -70,12 +90,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@master
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@master
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.0.0
|
||||
node-version: 12.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
@@ -84,17 +104,79 @@ jobs:
|
||||
run: eslint "src/**" --fix
|
||||
|
||||
- name: Commit changes
|
||||
uses: EndBug/add-and-commit@v2.1.1
|
||||
uses: EndBug/add-and-commit@v4
|
||||
with:
|
||||
author_name: Your Name
|
||||
author_email: mail@example.com
|
||||
message: "Your commit message"
|
||||
path: "."
|
||||
pattern: "*.js"
|
||||
add: "*.js"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
If you need to run the action on a repository that is not located in [`$GITHUB_WORKSPACE`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables), you can use the `cwd` option: the action uses a `cd` normal command, so the path should follow bash standards.
|
||||
|
||||
```yaml
|
||||
name: Use a different repository directory
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: Add a text file
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# If you need to, you can check out your repo to a different location
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: "./pathToRepo/"
|
||||
|
||||
# You can make whatever type of change to the repo...
|
||||
- run: echo "123" > ./pathToRepo/file.txt
|
||||
|
||||
# ...and then use the action as you would normally do, but providing the path to the repo
|
||||
- uses: EndBug/add-and-commit@v4
|
||||
with:
|
||||
message: "Add the very useful text file"
|
||||
add: "*.txt"
|
||||
cwd: "./pathToRepo/"
|
||||
force: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
## Contributors ✨
|
||||
|
||||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/EndBug"><img src="https://avatars1.githubusercontent.com/u/26386270?v=4" width="100px;" alt=""/><br /><sub><b>Federico Grandi</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=EndBug" title="Code">💻</a> <a href="https://github.com/EndBug/add-and-commit/commits?author=EndBug" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/jactor-rises"><img src="https://avatars3.githubusercontent.com/u/14565088?v=4" width="100px;" alt=""/><br /><sub><b>Tor Egil Jacobsen</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=jactor-rises" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://twitter.com/yelizariev"><img src="https://avatars0.githubusercontent.com/u/186131?v=4" width="100px;" alt=""/><br /><sub><b>Ivan Yelizariev</b></sub></a><br /><a href="#ideas-yelizariev" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://github.com/jhhughes"><img src="https://avatars2.githubusercontent.com/u/13724293?v=4" width="100px;" alt=""/><br /><sub><b>jhhughes</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3Ajhhughes" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://sunengine.site"><img src="https://avatars3.githubusercontent.com/u/10674646?v=4" width="100px;" alt=""/><br /><sub><b>Дмитрий Океаний</b></sub></a><br /><a href="#ideas-DmitrijOkeanij" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://github.com/brahma-dev"><img src="https://avatars3.githubusercontent.com/u/1793295?v=4" width="100px;" alt=""/><br /><sub><b>Brahma Dev</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3Abrahma-dev" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://github.com/felixlapalma"><img src="https://avatars2.githubusercontent.com/u/38389683?v=4" width="100px;" alt=""/><br /><sub><b>Felix Rojo Lapalma</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3Afelixlapalma" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="http://robinwijnant.me"><img src="https://avatars3.githubusercontent.com/u/33033209?v=4" width="100px;" alt=""/><br /><sub><b>Robin Wijnant</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3ARobinWijnant" title="Bug reports">🐛</a> <a href="https://github.com/EndBug/add-and-commit/commits?author=RobinWijnant" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/onilton"><img src="https://avatars2.githubusercontent.com/u/725676?v=4" width="100px;" alt=""/><br /><sub><b>Onilton Maciel</b></sub></a><br /><a href="#ideas-onilton" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://github.com/jsoref"><img src="https://avatars0.githubusercontent.com/u/2119212?v=4" width="100px;" alt=""/><br /><sub><b>Josh Soref</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=jsoref" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/ToMe25"><img src="https://avatars1.githubusercontent.com/u/38815969?v=4" width="100px;" alt=""/><br /><sub><b>ToMe25</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=ToMe25" title="Code">💻</a> <a href="#ideas-ToMe25" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://github.com/JonasJacobsUserspace"><img src="https://avatars0.githubusercontent.com/u/59708720?v=4" width="100px;" alt=""/><br /><sub><b>JonasJacobsUserspace</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3AJonasJacobsUserspace" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-enable -->
|
||||
<!-- prettier-ignore-end -->
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
||||
|
||||
## License
|
||||
|
||||
This action is distributed under the MIT license, check the [license](LICENSE) for more info.
|
||||
|
||||
63
action.yml
63
action.yml
@@ -1,36 +1,45 @@
|
||||
name: 'Add & Commit'
|
||||
description: 'Add & commit files from a path directly from GitHub Actions'
|
||||
name: Add & Commit
|
||||
description: Add & commit files from a path directly from GitHub Actions
|
||||
|
||||
inputs:
|
||||
add:
|
||||
description: Arguments for the git add command
|
||||
required: false
|
||||
default: "."
|
||||
author_name:
|
||||
description: 'The name of the user that will be displayed as the author of the commit'
|
||||
required: true
|
||||
default: 'Add & Commit GitHub Action'
|
||||
description: The name of the user that will be displayed as the author of the commit
|
||||
required: false
|
||||
author_email:
|
||||
description: 'The email of the user that will be displayed as the author of the commit'
|
||||
required: true
|
||||
default: 'actions@github.com'
|
||||
description: The email of the user that will be displayed as the author of the commit
|
||||
required: false
|
||||
cwd:
|
||||
description: The directory where your repository is located. You should use actions/checkout first to set it up
|
||||
required: false
|
||||
default: "."
|
||||
force:
|
||||
description: 'Whether to use the force option on git add, in order to bypass eventual gitignores'
|
||||
description: Whether to use the force option on git add, in order to bypass eventual gitignores
|
||||
required: false
|
||||
default: false
|
||||
default: "false"
|
||||
message:
|
||||
description: 'The message for the commit'
|
||||
required: true
|
||||
default: 'Commit from GitHub Actions'
|
||||
path:
|
||||
description: 'The path to stage files from'
|
||||
required: true
|
||||
default: '.'
|
||||
pattern:
|
||||
description: 'The pattern that mathces file names'
|
||||
description: The message for the commit
|
||||
required: false
|
||||
default: "*.*"
|
||||
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
default: Commit from GitHub Actions
|
||||
ref:
|
||||
description: Name of the branch to use, if different from the one that triggered the workflow
|
||||
required: false
|
||||
remove:
|
||||
description: Arguments for the git rm command
|
||||
required: false
|
||||
default: ""
|
||||
tag:
|
||||
description: The name of the tag to add to the new commit
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
branding:
|
||||
icon: 'git-commit'
|
||||
color: black
|
||||
runs:
|
||||
using: node12
|
||||
main: lib/index.js
|
||||
|
||||
branding:
|
||||
icon: git-commit
|
||||
color: gray-dark
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# Set up .netrc file with GitHub credentials
|
||||
git_setup() {
|
||||
cat <<- EOF > $HOME/.netrc
|
||||
machine github.com
|
||||
login $GITHUB_ACTOR
|
||||
password $GITHUB_TOKEN
|
||||
|
||||
machine api.github.com
|
||||
login $GITHUB_ACTOR
|
||||
password $GITHUB_TOKEN
|
||||
EOF
|
||||
chmod 600 $HOME/.netrc
|
||||
|
||||
git config --global user.email "actions@github.com"
|
||||
git config --global user.name "Add & Commit GitHub Action"
|
||||
}
|
||||
|
||||
add() {
|
||||
if $INPUT_FORCE
|
||||
then find $INPUT_PATH -name "$INPUT_PATTERN" | while read x; do git add -f $x; done
|
||||
else find $INPUT_PATH -name "$INPUT_PATTERN" | while read x; do git add $x; done
|
||||
fi
|
||||
}
|
||||
|
||||
# This is needed to make the check work for untracked files
|
||||
echo "Staging files in commit path..."
|
||||
add
|
||||
|
||||
echo "Checking for uncommitted changes in the git working tree..."
|
||||
# This section only runs if there have been file changes
|
||||
if ! git diff --cached --exit-code
|
||||
then
|
||||
git_setup
|
||||
|
||||
git fetch
|
||||
|
||||
# Verify if the branch needs to be created
|
||||
if ! git rev-parse --verify --quiet "${GITHUB_REF:11}"
|
||||
then
|
||||
echo "Creating branch..."
|
||||
git branch "${GITHUB_REF:11}"
|
||||
fi
|
||||
|
||||
# Switch to branch from current workflow run
|
||||
echo "Switching branch..."
|
||||
git checkout "${GITHUB_REF:11}"
|
||||
|
||||
echo "Adding files..."
|
||||
add
|
||||
|
||||
echo "Creating commit..."
|
||||
git commit -m "$INPUT_MESSAGE" --author="$INPUT_AUTHOR_NAME <$INPUT_AUTHOR_EMAIL>"
|
||||
|
||||
echo "Pushing to repo..."
|
||||
git push --set-upstream origin "${GITHUB_REF:11}"
|
||||
else
|
||||
echo "Working tree clean. Nothing to commit."
|
||||
fi
|
||||
0
lib/.gitkeep
Normal file
0
lib/.gitkeep
Normal file
89
lib/entrypoint.sh
Executable file
89
lib/entrypoint.sh
Executable file
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
set -u
|
||||
|
||||
echo "::group::Internal logs"
|
||||
|
||||
cd $INPUT_CWD
|
||||
echo "Running in $PWD."
|
||||
|
||||
# Set up .netrc file with GitHub credentials
|
||||
git_setup() {
|
||||
cat <<-EOF >$HOME/.netrc
|
||||
machine github.com
|
||||
login $GITHUB_ACTOR
|
||||
password $GITHUB_TOKEN
|
||||
|
||||
machine api.github.com
|
||||
login $GITHUB_ACTOR
|
||||
password $GITHUB_TOKEN
|
||||
EOF
|
||||
chmod 600 $HOME/.netrc
|
||||
git config --global user.email "$INPUT_AUTHOR_EMAIL"
|
||||
git config --global user.name "$INPUT_AUTHOR_NAME"
|
||||
}
|
||||
|
||||
add() {
|
||||
if $INPUT_FORCE; then f=-f; else f=; fi
|
||||
git add $INPUT_ADD $f
|
||||
}
|
||||
|
||||
remove() {
|
||||
if [ -n "$INPUT_REMOVE" ]; then git rm $INPUT_REMOVE; fi
|
||||
}
|
||||
|
||||
tag() {
|
||||
if [ -n "$INPUT_TAG" ]; then git tag $INPUT_TAG; fi
|
||||
}
|
||||
|
||||
# This is needed to make the check work for untracked files
|
||||
echo "Staging files..."
|
||||
add
|
||||
remove
|
||||
|
||||
echo "Checking for uncommitted changes in the git working tree..."
|
||||
# This section only runs if there have been file changes
|
||||
if ! git diff --cached --quiet --exit-code; then
|
||||
git_setup
|
||||
|
||||
git fetch
|
||||
|
||||
# Verify if the branch needs to be created
|
||||
if ! git rev-parse --verify --quiet "$INPUT_REF"; then
|
||||
echo "Creating branch..."
|
||||
git branch "$INPUT_REF"
|
||||
fi
|
||||
|
||||
# Switch to branch from current workflow run
|
||||
echo "Switching branch..."
|
||||
git checkout "$INPUT_REF"
|
||||
|
||||
echo "Pulling from remote..."
|
||||
git fetch && git pull
|
||||
|
||||
echo "Resetting files..."
|
||||
git reset
|
||||
|
||||
echo "Adding files..."
|
||||
add
|
||||
|
||||
echo "Removing files..."
|
||||
remove
|
||||
|
||||
echo "Creating commit..."
|
||||
git commit -m "$INPUT_MESSAGE" --author="$INPUT_AUTHOR_NAME <$INPUT_AUTHOR_EMAIL>"
|
||||
|
||||
echo "Tagging commit..."
|
||||
tag
|
||||
|
||||
echo "Pushing commits to repo..."
|
||||
git push --set-upstream origin "$INPUT_REF"
|
||||
|
||||
echo "Pushing tags to repo..."
|
||||
git push --set-upstream origin "$INPUT_REF" --force --tags
|
||||
|
||||
echo "::endgroup::"
|
||||
echo "Task completed."
|
||||
else
|
||||
echo "::endgroup::"
|
||||
echo "Working tree clean. Nothing to commit."
|
||||
fi
|
||||
1
lib/index.js
Normal file
1
lib/index.js
Normal file
File diff suppressed because one or more lines are too long
1956
package-lock.json
generated
Normal file
1956
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
41
package.json
Normal file
41
package.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "add-and-commit",
|
||||
"version": "4.2.0",
|
||||
"description": "Add & commit files from a path directly from GitHub Actions",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build": "npm i && ncc build src/main.ts --minify --out lib",
|
||||
"watch": "ncc build src/main.ts --watch --out lib",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/EndBug/add-and-commit.git"
|
||||
},
|
||||
"keywords": [
|
||||
"github",
|
||||
"action",
|
||||
"version",
|
||||
"npm",
|
||||
"node"
|
||||
],
|
||||
"author": "Federico Grandi <fgrandi30@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/EndBug/add-and-commit/issues"
|
||||
},
|
||||
"homepage": "https://github.com/EndBug/add-and-commit#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.7.12",
|
||||
"@types/shelljs": "^0.8.6",
|
||||
"@typescript-eslint/eslint-plugin": "^2.12.0",
|
||||
"@typescript-eslint/parser": "^2.12.0",
|
||||
"@zeit/ncc": "^0.21.1",
|
||||
"all-contributors-cli": "^6.16.1",
|
||||
"eslint": "^6.8.0",
|
||||
"typescript": "^3.6.4"
|
||||
}
|
||||
}
|
||||
89
src/entrypoint.sh
Executable file
89
src/entrypoint.sh
Executable file
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
set -u
|
||||
|
||||
echo "::group::Internal logs"
|
||||
|
||||
cd $INPUT_CWD
|
||||
echo "Running in $PWD."
|
||||
|
||||
# Set up .netrc file with GitHub credentials
|
||||
git_setup() {
|
||||
cat <<-EOF >$HOME/.netrc
|
||||
machine github.com
|
||||
login $GITHUB_ACTOR
|
||||
password $GITHUB_TOKEN
|
||||
|
||||
machine api.github.com
|
||||
login $GITHUB_ACTOR
|
||||
password $GITHUB_TOKEN
|
||||
EOF
|
||||
chmod 600 $HOME/.netrc
|
||||
git config --global user.email "$INPUT_AUTHOR_EMAIL"
|
||||
git config --global user.name "$INPUT_AUTHOR_NAME"
|
||||
}
|
||||
|
||||
add() {
|
||||
if $INPUT_FORCE; then f=-f; else f=; fi
|
||||
git add $INPUT_ADD $f
|
||||
}
|
||||
|
||||
remove() {
|
||||
if [ -n "$INPUT_REMOVE" ]; then git rm $INPUT_REMOVE; fi
|
||||
}
|
||||
|
||||
tag() {
|
||||
if [ -n "$INPUT_TAG" ]; then git tag $INPUT_TAG; fi
|
||||
}
|
||||
|
||||
# This is needed to make the check work for untracked files
|
||||
echo "Staging files..."
|
||||
add
|
||||
remove
|
||||
|
||||
echo "Checking for uncommitted changes in the git working tree..."
|
||||
# This section only runs if there have been file changes
|
||||
if ! git diff --cached --quiet --exit-code; then
|
||||
git_setup
|
||||
|
||||
git fetch
|
||||
|
||||
# Verify if the branch needs to be created
|
||||
if ! git rev-parse --verify --quiet "$INPUT_REF"; then
|
||||
echo "Creating branch..."
|
||||
git branch "$INPUT_REF"
|
||||
fi
|
||||
|
||||
# Switch to branch from current workflow run
|
||||
echo "Switching branch..."
|
||||
git checkout "$INPUT_REF"
|
||||
|
||||
echo "Pulling from remote..."
|
||||
git fetch && git pull
|
||||
|
||||
echo "Resetting files..."
|
||||
git reset
|
||||
|
||||
echo "Adding files..."
|
||||
add
|
||||
|
||||
echo "Removing files..."
|
||||
remove
|
||||
|
||||
echo "Creating commit..."
|
||||
git commit -m "$INPUT_MESSAGE" --author="$INPUT_AUTHOR_NAME <$INPUT_AUTHOR_EMAIL>"
|
||||
|
||||
echo "Tagging commit..."
|
||||
tag
|
||||
|
||||
echo "Pushing commits to repo..."
|
||||
git push --set-upstream origin "$INPUT_REF"
|
||||
|
||||
echo "Pushing tags to repo..."
|
||||
git push --set-upstream origin "$INPUT_REF" --force --tags
|
||||
|
||||
echo "::endgroup::"
|
||||
echo "Task completed."
|
||||
else
|
||||
echo "::endgroup::"
|
||||
echo "Working tree clean. Nothing to commit."
|
||||
fi
|
||||
36
src/main.ts
Normal file
36
src/main.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { info, setFailed, getInput, warning } from '@actions/core'
|
||||
import { execFile } from 'child_process'
|
||||
import { join } from 'path'
|
||||
|
||||
try {
|
||||
checkInputs()
|
||||
const child = execFile(join(__dirname, 'entrypoint.sh'), [], { shell: true })
|
||||
child.stdout?.pipe(process.stdout)
|
||||
child.stderr?.pipe(process.stderr)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
setFailed(err instanceof Error ? err.message : err)
|
||||
}
|
||||
|
||||
function checkInputs() {
|
||||
const eventPath = process.env.GITHUB_EVENT_PATH
|
||||
const author = eventPath && require(eventPath)?.head_commit?.author
|
||||
|
||||
if (author) {
|
||||
setDefault('author_name', author.name)
|
||||
setDefault('author_email', author.email)
|
||||
} else {
|
||||
if (!getInput('author_name') || !getInput('author_email')) warning(`Unable to fetch author info: couldn't find ${!eventPath ? 'event path' : !require(eventPath)?.head_commit ? 'commit' : 'commit author'}.`)
|
||||
setDefault('author_name', 'Add & Commit Action')
|
||||
setDefault('author_email', 'actions@github.com')
|
||||
}
|
||||
|
||||
setDefault('ref', process.env.GITHUB_REF?.substring(11) || '')
|
||||
|
||||
info(`Using '${getInput('author_name')} <${getInput('author_email')}>' as author.`)
|
||||
}
|
||||
|
||||
function setDefault(input: string, value: string) {
|
||||
const key = 'INPUT_' + input.toUpperCase()
|
||||
if (!process.env[key]) process.env[key] = value
|
||||
}
|
||||
61
tsconfig.json
Normal file
61
tsconfig.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"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. */
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/*.test.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user