Compare commits

...

8 Commits

Author SHA1 Message Date
Peter Evans
7beba58e42 Merge pull request #45 from peter-evans/git-lfs
Update Docker Image to include support for git-lfs
2019-09-26 13:27:02 +09:00
Quin Outland
062968931c Update Docker Image to include support for git-lfs 2019-09-26 12:34:25 +09:00
Peter Evans
76116b7f39 Update README 2019-09-25 23:58:47 +09:00
Peter Evans
e635c55400 Update README 2019-09-25 09:42:45 +09:00
Peter Evans
9e25487be4 Update workflows 2019-09-25 09:25:52 +09:00
Peter Evans
39529236f7 Update README 2019-09-24 20:35:00 +09:00
Peter Evans
f0728e6543 Update README 2019-09-24 20:27:25 +09:00
Peter Evans
188c998f8f Update README 2019-09-24 20:23:49 +09:00
5 changed files with 54 additions and 17 deletions

View File

@@ -0,0 +1,28 @@
on:
repository_dispatch:
types: [create-pull-request-multi]
name: create-pull-request action testing workflow
jobs:
createPullRequest:
name: Testing on ${{ matrix.platform }}
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
- name: Create report file
if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
run: touch report.txt
- name: Create report file (windows)
if: matrix.platform == 'windows-latest'
run: type NUL > report.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@multi-platform-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MESSAGE: Add report file
PULL_REQUEST_BODY: This PR is auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request).
PULL_REQUEST_BRANCH: test-patches
PULL_REQUEST_TITLE: '[Test] Add report file'
BRANCH_SUFFIX: 'timestamp'

View File

@@ -1,6 +1,6 @@
on:
repository_dispatch:
types: [test]
types: [create-pull-request]
name: create-pull-request action testing workflow
jobs:
createPullRequest:
@@ -8,10 +8,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Create report file
uses: finnp/create-file-action@1.0.0
env:
FILE_DATA: This is created to test create-pull-request action.
FILE_NAME: report.txt
run: touch report.txt
- name: Create Pull Request
uses: ./
env:

View File

@@ -1,4 +1,4 @@
FROM python:3.7.3
FROM alpine:3.10.2
LABEL maintainer="Peter Evans <mail@peterevans.dev>"
LABEL repository="https://github.com/peter-evans/create-pull-request"
@@ -11,8 +11,10 @@ LABEL com.github.actions.color="gray-dark"
COPY LICENSE README.md /
RUN apk add python3-dev git git-lfs
COPY requirements.txt /tmp/
RUN pip install --requirement /tmp/requirements.txt
RUN pip3 install --requirement /tmp/requirements.txt
COPY create-pull-request.py /create-pull-request.py
ENTRYPOINT [ "/create-pull-request.py" ]

View File

@@ -3,25 +3,34 @@
A GitHub action to create a pull request for changes to your repository in the actions workspace.
Changes to a repository in the actions workspace persist between actions in a workflow.
This action is designed to be used in conjunction with other actions that modify or add files to your repository.
Changes to a repository in the Actions workspace persist between steps in a workflow.
This action is designed to be used in conjunction with other steps that modify or add files to your repository.
The changes will be automatically committed to a new branch and a pull request created.
Create Pull Request action will:
1. Check for repository changes in the actions workspace. This includes untracked (new) files as well as modified files.
1. Check for repository changes in the Actions workspace. This includes untracked (new) files as well as modified files.
2. Commit all changes to a new branch. The commit will be made using the name and email of the `HEAD` commit author.
3. Create a pull request to merge the new branch into the currently active branch executing the workflow.
Note: Modifying a repository during workflows is not good practice in general.
However, this action opens up some interesting possibilities when used carefully.
This action is experimental and may not work well for repositories that have a very high frequency of commits.
This action is experimental and may not work well for some use cases.
## Usage
Linux
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.2.0
uses: peter-evans/create-pull-request@v1.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Multi platform - Linux, MacOS, Windows (beta)
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.2.1-multi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
@@ -31,10 +40,10 @@ This action is experimental and may not work well for repositories that have a v
These variables are all optional. If not set, a default value will be used.
- `PULL_REQUEST_BRANCH` - The branch name. See **Branch naming** below for details.
- `BRANCH_SUFFIX` - The branch suffix type. Valid values are `short-commit-hash` (default) and `timestamp`. See **Branch naming** below for details.
- `COMMIT_MESSAGE` - The message to use when committing changes.
- `PULL_REQUEST_TITLE` - The title of the pull request.
- `PULL_REQUEST_BODY` - The body of the pull request.
- `BRANCH_SUFFIX` - Valid values are `short-commit-hash` and `timestamp`. See **Branch naming** below for details.
The following parameters are available for debugging and troubleshooting.
@@ -52,7 +61,7 @@ create-pull-request/patch-fcdfb59
create-pull-request/patch-394710b
```
Alternatively, branches can be suffixed with a timestamp by setting the environment variable `BRANCH_SUFFIX` to the value `timestamp`. This option may be necessary if multiple pull requests will be created during the execution of a workflow.
Alternatively, branches can be suffixed with a timestamp by setting the environment variable `BRANCH_SUFFIX` to the value `timestamp`. This option must be used if multiple pull requests will be created during the execution of a workflow.
e.g.
```
@@ -70,10 +79,11 @@ Here is an example that sets all the main environment variables.
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.2.0
uses: peter-evans/create-pull-request@v1.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_BRANCH: my-patches
BRANCH_SUFFIX: short-commit-hash
COMMIT_MESSAGE: Auto-modify files by my-file-modifier-action
PULL_REQUEST_TITLE: Changes from my-file-modifier-action
PULL_REQUEST_BODY: This is an auto-generated PR with changes from my-file-modifier-action