From ce70c1eb7a35da9fc9816e78dc98a2a2a5f410bc Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 22 Jun 2020 12:24:08 +0900 Subject: [PATCH] prereleased (#29) --- .github/workflows/prereleased.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/prereleased.yml diff --git a/.github/workflows/prereleased.yml b/.github/workflows/prereleased.yml new file mode 100644 index 00000000..3ba4f427 --- /dev/null +++ b/.github/workflows/prereleased.yml @@ -0,0 +1,33 @@ +name: prereleased + +on: + release: + types: [prereleased] + +jobs: + check-tag-branch: + runs-on: ubuntu-latest + steps: + - name: get tag commit hash + id: tag-commit-hash + run: echo "::set-output name=tag-hash::${{ github.sha }}" + - name: checkout master + uses: actions/checkout@v2 + with: + ref: master + - name: get latest master commit hash + id: master-commit-hash + run: | + hash=$(git log -n1 --format=format:"%H") + echo "::set-output name=master-hash::${hash}" + - name: exit if tag commit hash doesn't match with the master commit hash + if: steps.tag-commit-hash.outputs.tag-hash != steps.master-commit-hash.outputs.master-hash + run: exit 1 + deploy: + needs: check-tag-branch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: deploy + run: | + echo "preleased"