diff --git a/Dockerfile b/Dockerfile index efdf6b2..5d5a6f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ -FROM ubuntu:18.04 - -RUN apt-get update && apt-get install -y git +FROM alpine/git COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index aa62462..69781ca 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # Reset Git Branch -Reset a specific branch to another. Useful if you need a specific branch to be reset to say master at given intervals. NOTE: this action performs a _reset_ on the repository and is **destructive** - you will lose any changes made to the branch being reset. Be sure this is what you want to do before running. +Reset a specific branch to another. Useful if you need a specific branch to be reset to say main at given intervals. NOTE: this action performs a _reset_ on the repository and is **destructive** - you will lose any changes made to the branch being reset. Be sure this is what you want to do before running. ## Usage Example Workflow using a schedule. ```yaml -name: Rest Dev Branch to Master at 1am each day +name: Rest Dev Branch to Main at 1am each day on: schedule: - cron: "0 1 * * *" @@ -16,8 +16,8 @@ jobs: name: Runner runs-on: ubuntu-latest steps: - - name: Reset dev branch to master - uses: nicksnell/action-reset-repo@master + - name: Reset dev branch to main + uses: nicksnell/action-reset-repo@main with: reset_branch: dev ``` @@ -27,7 +27,7 @@ jobs: | name | value | default | description | | ---- | ----- | ------- | ----------- | | github_token | string | | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. | -| base_branch | string | 'master' | Branch to be used to reset too | +| base_branch | string | 'main' | Branch to be used to reset too | | reset_branch | string | - | Determines the branch to be reset | ## License diff --git a/action.yml b/action.yml index 733e0ad..c3f80db 100644 --- a/action.yml +++ b/action.yml @@ -8,7 +8,7 @@ inputs: base_branch: description: "Branch you want to use as the base to reset too" required: true - default: "master" + default: "main" reset_branch: description: "Branch you want to reset" required: true diff --git a/entrypoint.sh b/entrypoint.sh index d05d485..9a3b691 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash -l +#!/bin/sh BASE_BRANCH=$1 RESET_BRANCH=$2 @@ -18,7 +18,7 @@ echo "BASE_BRANCH=${BASE_BRANCH}" echo "RESET_BRANCH=${RESET_BRANCH}" -mkdir _tmp && cd _tmp +mkdir -p /tmp/_tmp && cd /tmp/_tmp git init