Skip to content

Commit

Permalink
Update update-package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
crashkonijn authored Nov 3, 2023
1 parent d573d8e commit b444b42
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/update-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
uses: actions/checkout@v2
with:
ref: 'master'
fetch-depth: 0 # ensure you have the full history for branch creation

- name: Setup Node.js
uses: actions/setup-node@v2
Expand Down Expand Up @@ -44,13 +45,21 @@ jobs:
git add Package/package.json
git add README.md
git add Package/Documentation/Introduction/GettingStarted.md
# Check if there are any changes to commit
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "Update version to ${{ github.event.inputs.version }}"
git push
fi
- name: Push changes
run: git push origin update-version-${{ github.event.inputs.version }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update version to ${{ github.event.inputs.version }}
title: "Update package version to ${{ github.event.inputs.version }}"
body: |
Update package version to `${{ github.event.inputs.version }}`.
base: master # branch to create the PR against
branch: update-version-${{ github.event.inputs.version }} # branch with your changes

build_demo_files:
needs:
- update_versions
Expand All @@ -60,6 +69,9 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v2
with:
ref: update-version-${{ needs.update_versions.outputs.branch }} # Use the output from the previous job

- run: |
cd Demo
echo "Assets/CrashKonijn.meta" > metaList
Expand Down Expand Up @@ -88,4 +100,7 @@ jobs:
git config user.email "[email protected]"
git add Package/Samples~/default/demo.unitypackage
git commit -m "Updated demo"
git push
- name: Push demo files
if: steps.filter.outputs.workflows == 'true'
run: git push origin update-version-${{ github.event.inputs.version }}

0 comments on commit b444b42

Please sign in to comment.