๐Ÿ“ฆ yehao09 / skills-release-based-workflow

๐Ÿ“„ initialize-repository.sh ยท 35 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35#!/usr/bin/env bash
# Make sure this file is executable
# chmod a+x .github/script/initialize-repository.sh

echo "Set committer details"
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com

echo "Create release branch"
RELEASE_BRANCH=release-v1.0
git checkout main
git checkout -b $RELEASE_BRANCH

echo "Push release branch"
git commit --allow-empty --message="Empty commit to initialize branch"
git push --set-upstream origin $RELEASE_BRANCH

echo "Create feature branch"
git checkout main
FEATURE_BRANCH=update-text-colors
git checkout -b $FEATURE_BRANCH

echo "Make changes to files"
cp .github/changes/engine.js engine.js
cp .github/changes/game-with-bug.js game.js

echo "Commit file changes"
git add engine.js game.js
git commit -m "Changed game text colors to green"

echo "Push feature branch"
git push --set-upstream origin $FEATURE_BRANCH

echo "Restore main"
git checkout main