Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 4.1.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3.1.0...v4.1.4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
37 lines
925 B
YAML
37 lines
925 B
YAML
name: Master branch updater.
|
|
|
|
on:
|
|
release:
|
|
types: released
|
|
|
|
jobs:
|
|
updater:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
SKIP: "0"
|
|
to_branch: "master"
|
|
steps:
|
|
- uses: actions/checkout@v4.1.4
|
|
with:
|
|
fetch-depth: 0
|
|
if: env.SKIP == '0'
|
|
- name: Push the code to the master branch.
|
|
if: env.SKIP == '0'
|
|
run: |
|
|
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
|
|
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!"
|