Compare commits

...

5 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
5 changed files with 50 additions and 14 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" ]
ENTRYPOINT [ "/create-pull-request.py" ]

View File

@@ -3,13 +3,13 @@
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.
@@ -19,6 +19,7 @@ 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.1
@@ -26,12 +27,20 @@ This action is experimental and may not work well for some use cases.
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 }}
```
#### Environment variables
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` - Valid values are `short-commit-hash` and `timestamp`. 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.
@@ -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.
```

View File

@@ -1,2 +1,2 @@
GitPython==3.0.2
PyGithub==1.43.8
PyGithub==1.43.8