Skip to content

Commit

Permalink
add release tyep
Browse files Browse the repository at this point in the history
  • Loading branch information
lonerapier committed Oct 29, 2024
1 parent f96b023 commit 6bcfbb0
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,11 @@ concurrency:

on:
release:
types: [published]
types: [created, published, released]
pull_request:
branches: [ "main" ]

jobs:
check-version:
name: Check package.json version update
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2 # Fetch two commits to get the base branch

- name: Fetch main branch
run: |
git fetch origin main
- name: Compare package.json version with main
id: version_check
run: |
# Extract version from package.json in PR branch
PR_VERSION=$(jq -r .version package.json)
# Extract version from package.json in main branch
MAIN_VERSION=$(git show origin/main:package.json | jq -r .version)
echo "PR version: $PR_VERSION"
echo "Main version: $MAIN_VERSION"
# Fail if versions match
if [ "$PR_VERSION" == "$MAIN_VERSION" ]; then
echo "Error: package.json version has not been updated in this PR."
exit 1
else
echo "package.json version has been updated in this PR."
fi
build:
runs-on: ubuntu-latest

Expand Down

0 comments on commit 6bcfbb0

Please sign in to comment.