diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..451ae2b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ruby:2.6.1-alpine3.9 + +LABEL "com.github.actions.name"="git-pr-release" +LABEL "com.github.actions.description"="Run git-pr-release" +LABEL "com.github.actions.icon"="check-square" +LABEL "com.github.actions.color"="green" + +LABEL "repository"="https://github.com/bakunyo/git-pr-release-action" +LABEL "maintainer"="bakunyo " + +RUN apk add --no-cache git +RUN gem install git-pr-release + +ADD entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..14deaa2 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# git-pr-release-action +GitHub Action to run [git-pr-release](https://github.com/motemen/git-pr-release) + +### Usage +For example, here is a workflow to run `git-pr-release` when push to staging. + +``` +workflow "Create PR to master" { + resolves = ["git-pr-release"] + on = "push" +} + +action "Filter branch" { + uses = "actions/bin/filter@24a566c2524e05ebedadef0a285f72dc9b631411" + args = "branch staging" +} + +action "git-pr-release" { + uses = "bakunyo/git-pr-release-action@master" + needs = ["Filter branch"] + secrets = [ + "GIT_PR_RELEASE_TOKEN", + "GITHUB_TOKEN", + ] +} +``` + +### Secrets(required) +#### `GIT_PR_RELEASE_TOKEN` +Add [GIT_PR_RELEASE_TOKEN](https://github.com/motemen/git-pr-release#pr-releasetoken) as [secret](https://developer.github.com/actions/creating-workflows/storing-secrets/#storing-secrets) to create pull request. + +#### `GITHUB_TOKEN` +Add [GITHUB_TOKEN secret](https://developer.github.com/actions/creating-workflows/storing-secrets/#github-token-secret) to make authenticated calls to the GitHub API. + +### Environment variables(optional) +Any environment variables defined by [git-pr-release](https://github.com/motemen/git-pr-release) also can use on this action (`GIT_PR_RELEASE_BRANCH_PRODUCTION`, `GIT_PR_RELEASE_BRANCH_STAGING` etc). diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..2f49f21 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +set -eu +git-pr-release