Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff8ca18c9f |
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -10,12 +10,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 12.x
|
||||
node-version: 12.0.0
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
run: npm run build
|
||||
|
||||
- name: Commit changes
|
||||
uses: EndBug/add-and-commit@v2
|
||||
uses: EndBug/add-and-commit@v2.3.0
|
||||
with:
|
||||
force: true
|
||||
message: "[auto] Update compiled version"
|
||||
|
||||
36
README.md
36
README.md
@@ -15,7 +15,6 @@ Add a step like this to your workflow:
|
||||
with: # See more info about inputs below
|
||||
author_name: Your Name
|
||||
author_email: mail@example.com
|
||||
cwd: "."
|
||||
message: "Your commit message"
|
||||
path: "."
|
||||
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_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
|
||||
- `path` : the path(s) to stage files from
|
||||
- `pattern` : the pattern that matches file names
|
||||
@@ -72,7 +70,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
@@ -97,38 +95,6 @@ jobs:
|
||||
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
|
||||
|
||||
This action is distributed under the MIT license, check the [license](LICENSE) for more info.
|
||||
|
||||
@@ -8,10 +8,6 @@ inputs:
|
||||
author_email:
|
||||
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
|
||||
required: false
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
cd $INPUT_CWD
|
||||
echo "Running in $PWD."
|
||||
|
||||
# Set up .netrc file with GitHub credentials
|
||||
git_setup() {
|
||||
cat <<- EOF > $HOME/.netrc
|
||||
|
||||
Reference in New Issue
Block a user