2020-05-05 20:29:09 +00:00
|
|
|
name: Master branch updater.
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: released
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
updater:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
SKIP: "0"
|
|
|
|
to_branch: "master"
|
|
|
|
steps:
|
2022-11-07 12:32:59 +00:00
|
|
|
- uses: actions/checkout@v3.1.0
|
2020-05-09 14:15:31 +00:00
|
|
|
if: env.SKIP == '0'
|
2020-05-05 20:29:09 +00:00
|
|
|
- name: Push the code to the master branch.
|
2020-05-09 14:15:31 +00:00
|
|
|
if: env.SKIP == '0'
|
2020-05-05 20:29:09 +00:00
|
|
|
run: |
|
2020-05-09 14:15:31 +00:00
|
|
|
token=${{ secrets.TOKEN_FOR_MASTER_UPDATER }}
|
|
|
|
if [ -z "${token}" ]; then
|
|
|
|
echo "Token is unset. Nothing to do."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
url=https://x-access-token:$token@github.com/$GITHUB_REPOSITORY
|
2020-05-05 20:29:09 +00:00
|
|
|
latest_tag=$(git describe --tags --abbrev=0)
|
|
|
|
echo "Latest tag: $latest_tag"
|
|
|
|
|
|
|
|
git remote set-url origin $url
|
|
|
|
git remote -v
|
|
|
|
git checkout master
|
|
|
|
git merge $latest_tag
|
|
|
|
|
|
|
|
git push origin HEAD:refs/heads/$to_branch
|
|
|
|
echo "Done!"
|