-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from christian1980nrw/dev
merge
- Loading branch information
Showing
6 changed files
with
461 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Main Versioning | ||
|
||
# This workflow triggers when a pull request to the 'main' branch is closed | ||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
update_version: | ||
# Ensure this job only runs if the PR was merged, not just closed without merging | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Update VERSION in main | ||
run: | | ||
# Attempt to remove the -DEV suffix from the version number | ||
NEW_VERSION=$(sed -n 's/^VERSION=\"\(.*\)-DEV\"$/\1/p' scripts/controller.sh) | ||
# If NEW_VERSION is empty (meaning there was no -DEV), take the current value of VERSION | ||
if [[ -z $NEW_VERSION ]]; then | ||
NEW_VERSION=$(sed -n 's/^VERSION=\"\(.*\)\"$/\1/p' scripts/controller.sh) | ||
fi | ||
# Replace VERSION in the file with the NEW_VERSION value | ||
sed -i "s/^VERSION=\".*\"$/VERSION=\"${NEW_VERSION}\"/" scripts/controller.sh | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -am "Update version to ${NEW_VERSION}" | ||
git push origin main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.