Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
only assume it's an initial run if the version already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Oct 18, 2021
1 parent 96602c7 commit 67207ed
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ jobs:
- name: Determine version
run: echo "VERSION=$(jq -r .version version.json)" >> $GITHUB_ENV
- name: Check if this is the initial deployment
# if this is the initial deployment of this workflow, we don't need to run any checks
# This is the initial run (deploying the version.json to this repo) if
# 1. version.json didn't exist before, AND
# 2. there doesn't exist a git tag for the version (as read from version.json)
# In that case, we don't need to run the rest of the workflow.
run: |
git fetch origin ${{ github.event.pull_request.base.sha }}
git fetch origin --tags
read -ra arr <<< $(git diff-index ${{ github.event.pull_request.base.sha }} -- version.json)
if [[ "${arr[4]}" == "A" ]]; then
git rev-list ${{ env.VERSION }} &> /dev/null
status=$?
if [[ "${arr[4]}" == "A" && $status == 0 ]]; then
echo "INITIAL_RUN=true" >> $GITHUB_ENV
fi
- name: Install semver (node command line tool)
Expand Down

0 comments on commit 67207ed

Please sign in to comment.