Compare commits

..

1 Commits

Author SHA1 Message Date
Federico Grandi
ff8ca18c9f Commit dist files 2019-12-20 22:58:12 +01:00
4 changed files with 5 additions and 46 deletions

View File

@@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@master
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@master
with: with:
node-version: 12.x node-version: 12.0.0
- name: Install dependencies - name: Install dependencies
run: npm install run: npm install
@@ -24,7 +24,7 @@ jobs:
run: npm run build run: npm run build
- name: Commit changes - name: Commit changes
uses: EndBug/add-and-commit@v2 uses: EndBug/add-and-commit@v2.3.0
with: with:
force: true force: true
message: "[auto] Update compiled version" message: "[auto] Update compiled version"

View File

@@ -15,7 +15,6 @@ Add a step like this to your workflow:
with: # See more info about inputs below with: # See more info about inputs below
author_name: Your Name author_name: Your Name
author_email: mail@example.com author_email: mail@example.com
cwd: "."
message: "Your commit message" message: "Your commit message"
path: "." path: "."
pattern: "*.js" pattern: "*.js"
@@ -28,7 +27,6 @@ Add a step like this to your workflow:
- `author_name` : the name of the user that will be displayed as the author of the commit, defaults to the author of the commit that triggered the run - `author_name` : the name of the user that will be displayed as the author of the commit, defaults to the author of the commit that triggered the run
- `author_email` : the email of the user that will be displayed as the author of the commit, defaults to the author of the commit that triggered the run - `author_email` : the email of the user that will be displayed as the author of the commit, defaults to the author of the commit that triggered the run
- `cwd` : the working directory in which your repository is located, defaults to `.`
- `message` : the message for the commit - `message` : the message for the commit
- `path` : the path(s) to stage files from - `path` : the path(s) to stage files from
- `pattern` : the pattern that matches file names - `pattern` : the pattern that matches file names
@@ -72,7 +70,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v2 uses: actions/checkout@v1
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@v1
@@ -97,38 +95,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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 checkout 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@v2
with:
message: "Add the very useful text file"
path: "."
pattern: "*.txt"
cwd: "./pathToRepo/"
force: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## License ## License
This action is distributed under the MIT license, check the [license](LICENSE) for more info. This action is distributed under the MIT license, check the [license](LICENSE) for more info.

View File

@@ -8,10 +8,6 @@ inputs:
author_email: author_email:
description: The email of the user that will be displayed as the author of the commit description: The email of the user that will be displayed as the author of the commit
required: false 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: 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 required: false

View File

@@ -1,9 +1,6 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
cd $INPUT_CWD
echo "Running in $PWD."
# Set up .netrc file with GitHub credentials # Set up .netrc file with GitHub credentials
git_setup() { git_setup() {
cat <<- EOF > $HOME/.netrc cat <<- EOF > $HOME/.netrc