Creates pull requests for outdated Unity Editor and UPM package versions.
Simply add this file as .github/workflows/unityVersionCheck.yml
.
It's is an opinionated example which
- every day at 03:00 a.m.
- checks for new
- and creates a PR if
- the Unity project
- at the root of the repository this action is called from (see My Unity project is inside a subdirectory of my repository)
- is older than any found release
- the Unity project
name: Check for new Unity version
on:
schedule:
- cron: "* 3 * * *"
jobs:
updateCheck:
name: Create PR for newer Unity version
runs-on: ubuntu-latest
steps:
- name: Checkout your repository
uses: actions/checkout@v2
- name: Create PR if needed
uses: ViMaSter/unity-version-bump@v1
with:
releaseStreams: Stable,LTS
githubToken: ${{ secrets.GITHUB_TOKEN }}
My Unity project is inside a subdirectory of my repository
Assuming Unity's Assets
directory resides at [YOUR_REPOSITORY_ROOT]/projects/my-game/Assets
, add the unityProjectPath
input parameter as follows:
- name: Create PR if needed
uses: ViMaSter/unity-version-bump@v1
with:
unityProjectPath: projects/my-game # <-- add this line
releaseStreams: Stable,LTS
githubToken: ${{ secrets.GITHUB_TOKEN }}
Also creating PRs for alpha/beta stream releases
The releaseStreams
parameter accepts a comma-separated list of the following values in any order:
Alpha
Beta
Stable
LTS
Patch
This parameter has no default and needs to be set to at least one release stream.
- name: Create PR if needed
uses: ViMaSter/unity-version-bump@v1
with:
releaseStreams: Stable,LTS,Beta # <-- set this line
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR if needed
uses: ViMaSter/unity-version-bump@v1
with:
releaseStreams: Stable,LTS,Beta,Alpha # <-- set this line
githubToken: ${{ secrets.GITHUB_TOKEN }}
Get notified for only long-term support (LTS) stream releases
The releaseStreams
parameter accepts a comma-separated list of the following values in any order:
Alpha
Beta
Stable
LTS
Patch
This parameter has no default and needs to be set to at least one release stream.
To only include long-term support (LTS) stream releases
- name: Create PR if needed
uses: ViMaSter/unity-version-bump@v1
with:
releaseStreams: LTS # <-- set this line
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR if needed
uses: ViMaSter/unity-version-bump@v1
with:
releaseStreams: Beta # <-- set this line
githubToken: ${{ secrets.GITHUB_TOKEN }}
Highlighting pull requests created by this action (using labels)
The pullRequestLabels
parameter accepts a comma-separated list of labels.
Make sure each label exists as valid label for your repository. Labels missing here, might not be added or cause this action to fail.
- name: Create PR if needed
uses: ViMaSter/unity-version-bump@v1
with:
pullRequestLabels: dependencies # <-- set this line
releaseStreams: Stable,LTS
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR if needed
uses: ViMaSter/unity-version-bump@v1
with:
pullRequestLabels: dependencies,unity # <-- set this line
releaseStreams: Stable,LTS
githubToken: ${{ secrets.GITHUB_TOKEN }}
Using generated data like the current Unity version, newest Unity version or pull request ID in another action
This action creates the following output parameters:
Output parameter... | ...which describes... | ...is set when... | Example value |
---|---|---|---|
has-newer-version |
Whether or not a newer version of Unity exists inside the specified release streams | Always | True / False |
current-unity-version |
The version of Unity currently used inside this repository | Always | 2020.3.15f2 |
newest-unity-version |
The newest version of Unity available inside the specified release streams | If newer Unity Version is available | 2021.3.0f1 |
pull-request-id |
The ID of the pull request created | If newer Unity Version is available | 37 |