From 0bb5a21ea7688a2ae046537d103d0b69e1f0f6e7 Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Sat, 25 Apr 2020 14:23:32 +0100 Subject: [PATCH] v1 --- README.md | 8 ++++---- action.yml | 4 ++++ entrypoint.sh | 3 ++- lib/actions/checkout/README.md | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6afb1e6..8d1603d 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,14 @@ As a part of your [GitHub Actions](https://github.com/features/actions) workflow, add a new step as follows: ```yml -name: Deploy +name: Update on: push: schedule: - cron: "0 0 * * *" # Every day at midnight jobs: deploy: - name: Deploy + name: Update runs-on: ubuntu-latest steps: - name: Checkout @@ -50,10 +50,10 @@ The following input options are available: | `actor` | The GitHub user to commit changes with
e.g. `gregbrimble` | No | Defaults to the current user (`{{ github.actor }}`) | | `repository` | The workspace repository
e.g. `gregbrimble/tailwindui` | No | Defaults to the current repository (`{{ github.repository }}`). Should contain a `.env` file in the root. | | `crawler` | The repository of the crawler to use | No | Defaults to `kiliman/tailwindui-crawler` | +| `crawlerref` | The ref (branch, tag or SHA) to checkout of the crawler repository | No | Defaults to `master` | Note: If using a separate private repository for the output, you must include a Personal Access Token in the `token` input, as the `{{ github.token }}` tokens are scoped to only the current repository. ## Roadmap -- [] Specify crawler version -- [] Create a PR against the output repository +- [ ] Create a PR against the output repository diff --git a/action.yml b/action.yml index c286856..cae62a4 100644 --- a/action.yml +++ b/action.yml @@ -40,6 +40,10 @@ inputs: description: "The repository of the crawler (defaults to 'kiliman/tailwindui-crawler')" required: false default: "kiliman/tailwindui-crawler" + crawlerref: + description: "The ref (branch, tag or SHA) to checkout of the crawler" + required: false + default: "master" runs: using: "docker" image: "Dockerfile" diff --git a/entrypoint.sh b/entrypoint.sh index 404ca6b..fda1a53 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,13 +3,13 @@ export WORKSPACE_REPOSITORY="$INPUT_REPOSITORY" export CRAWLER_REPOSITORY="$INPUT_CRAWLER" export OUTPUT_REPOSITORY="$INPUT_OUTPUT" -export INPUT_REF="master" unset INPUT_REPOSITORY # Clone crawler echo "Cloning crawler..." mkdir /crawler +export INPUT_REF="$INPUT_CRAWLERREF" export GITHUB_WORKSPACE="/crawler" export GITHUB_REPOSITORY="$CRAWLER_REPOSITORY" @@ -24,6 +24,7 @@ npm install echo "Cloning workspace..." mkdir /workspace +export INPUT_REF="master" export GITHUB_WORKSPACE="/workspace" export GITHUB_REPOSITORY="$WORKSPACE_REPOSITORY" diff --git a/lib/actions/checkout/README.md b/lib/actions/checkout/README.md index 6870626..def8653 100644 --- a/lib/actions/checkout/README.md +++ b/lib/actions/checkout/README.md @@ -1,3 +1,3 @@ # Checkout Action -Taken from [dist/](https://github.com/actions/checkout/blob/01aecccf739ca6ff86c0539fbc67a7a5007bbc81/dist). +Taken from [dist/](https://github.com/actions/checkout/blob/01aecccf739ca6ff86c0539fbc67a7a5007bbc81/dist) and removed the `problem-matcher.json` matcher.