8
8
jobs :
9
9
cleanup_and_merge :
10
10
runs-on : ubuntu-latest
11
- outputs :
12
- proceed : ${{ steps.check_version.outputs.proceed }}
13
- main_tag : ${{ steps.check_version.outputs.MAIN_TAG }}
14
11
15
12
steps :
16
13
- name : Checkout code
@@ -24,37 +21,27 @@ jobs:
24
21
git config --local user.name "Lea Yeh"
25
22
26
23
- name : Check tag version
27
- id : check_version
28
24
run : |
29
- MAIN_TAG=""
30
- EVAL_TAG=""
31
25
MAIN_TAG=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null) || true
32
26
if [[ $(git tag --contains origin/evaluation | wc -l) -gt 0 ]]; then
33
27
EVAL_TAG=$(git describe --tags `git rev-list --tags --remotes=origin/evaluation --max-count=1` 2>/dev/null) || true
34
28
fi
35
- echo MAIN_TAG=$MAIN_TAG >> "$GITHUB_OUTPUT"
36
- echo EVAL_TAG=$EVAL_TAG >> "$GITHUB_OUTPUT"
37
29
echo "MAIN_TAG: $MAIN_TAG"
38
30
echo "EVAL_TAG: $EVAL_TAG"
39
- if [[ -z "$EVAL_TAG" && -n "$ MAIN_TAG" ]] || [[ "$MAIN_TAG" > "$EVAL_TAG" ]]; then
40
- echo "set to true"
41
- echo "proceed=true" >> "$GITHUB_OUTPUT "
31
+ echo main_tag=$ MAIN_TAG >> "$GITHUB_ENV"
32
+ if [[ "$MAIN_TAG" > "$EVAL_TAG" ]]; then
33
+ echo "proceed=true" >> "$GITHUB_ENV "
42
34
else
43
- echo "set to false"
44
- echo "proceed=false" >> "$GITHUB_OUTPUT"
35
+ echo "proceed=false" >> "$GITHUB_ENV"
45
36
fi
46
37
47
- - name : Print output for debugging
48
- run : |
49
- echo ${{ steps.check_version.outputs.proceed }}
50
-
51
38
- name : Setup evaluation branch
52
- if : steps.check_version.outputs .proceed == 'true'
39
+ if : env .proceed == 'true'
53
40
run : |
54
41
git checkout -b evaluation 2>/dev/null || git checkout evaluation
55
42
56
43
- name : Merge and delete forbidden files and commit
57
- if : steps.check_version.outputs .proceed == 'true'
44
+ if : env .proceed == 'true'
58
45
run : |
59
46
git merge origin/main
60
47
find . -type d -name .git -prune -o -type f ! -name '*.c' ! -name '*.h' ! -name '*.mk' ! -name 'Makefile' -exec rm -rf {} +
64
51
git commit -m "[GH-BOT] Remove forbidden files and empty folders"
65
52
66
53
- name : Set version tag on evaluation branch
67
- if : steps.check_version.outputs .proceed == 'true'
54
+ if : env .proceed == 'true'
68
55
run : |
69
- eval_tag ="${{ steps.check_version.outputs.MAIN_TAG }}-eval"
70
- git tag "$eval_tag "
71
- git push origin evaluation "$eval_tag "
56
+ EVAL_TAG ="${{ env.main_tag }}-eval"
57
+ git tag "$EVAL_TAG "
58
+ git push origin evaluation "$EVAL_TAG "
0 commit comments