1
0
reusable-workflows/.gitea/workflows/setPackageVersion.yaml

37 lines
1.1 KiB
YAML
Raw Normal View History

2024-10-18 06:46:44 +00:00
name: Set Package Version
on:
workflow_call:
inputs:
version:
required: true
type: string
branch:
required: true
type: string
jobs:
SetVersion:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set
run: |
2024-10-18 23:00:26 +00:00
git pull origin HEAD:${{ inputs.branch }}
2024-10-18 06:46:44 +00:00
echo "Setting Version to ${{ inputs.version }}"
npm version --no-git-tag-version ${{ inputs.version }}
- name: Commit version change
run: |
2024-10-18 23:00:26 +00:00
if git diff --quiet && git diff --cached --quiet; then
echo "No changes in the repository."
exit 0
fi
2024-10-18 06:46:44 +00:00
git config user.name "${{ vars.GIT_DEPLOY_NAME }}"
git config user.email "${{ vars.GIT_DEPLOY_MAIL }}"
git add package.json
git commit -m "Update package.json version to $TAG_VERSION"
- name: Push changes back to repository
run: |
git push origin HEAD:${{ inputs.branch }}