From 0c0fc46b90d318d6f8a258537abe9bbd11732239 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 5 May 2020 23:29:09 +0300 Subject: [PATCH] Added Github Action that updates code in master branch. --- .github/workflows/master_updater.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/master_updater.yml diff --git a/.github/workflows/master_updater.yml b/.github/workflows/master_updater.yml new file mode 100644 index 000000000..1d8e50ae0 --- /dev/null +++ b/.github/workflows/master_updater.yml @@ -0,0 +1,27 @@ +name: Master branch updater. + +on: + release: + types: released + +jobs: + updater: + runs-on: ubuntu-latest + env: + SKIP: "0" + to_branch: "master" + steps: + - uses: actions/checkout@v1 + - name: Push the code to the master branch. + run: | + url=https://x-access-token:${{ secrets.GITHUB_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!"