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,29 +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
25
MAIN_TAG=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null) || true
30
26
if [[ $(git tag --contains origin/evaluation | wc -l) -gt 0 ]]; then
31
27
EVAL_TAG=$(git describe --tags `git rev-list --tags --remotes=origin/evaluation --max-count=1` 2>/dev/null) || true
32
28
fi
33
29
echo "MAIN_TAG: $MAIN_TAG"
34
30
echo "EVAL_TAG: $EVAL_TAG"
35
- echo MAIN_TAG=$MAIN_TAG >> "$GITHUB_OUTPUT"
36
- echo EVAL_TAG=$EVAL_TAG >> "$GITHUB_OUTPUT"
31
+ echo main_tag=$MAIN_TAG >> "$GITHUB_ENV"
37
32
if [[ "$MAIN_TAG" > "$EVAL_TAG" ]]; then
38
- echo "PROCEED =true" >> "$GITHUB_OUTPUT "
33
+ echo "proceed =true" >> "$GITHUB_ENV "
39
34
else
40
- echo "PROCEED =false" >> "$GITHUB_OUTPUT "
35
+ echo "proceed =false" >> "$GITHUB_ENV "
41
36
fi
42
37
43
38
- name : Setup evaluation branch
44
- if : steps.check_version.outputs .proceed == 'true'
39
+ if : env .proceed == 'true'
45
40
run : |
46
41
git checkout -b evaluation 2>/dev/null || git checkout evaluation
47
42
48
43
- name : Merge and delete forbidden files and commit
49
- if : steps.check_version.outputs .proceed == 'true'
44
+ if : env .proceed == 'true'
50
45
run : |
51
46
git merge origin/main
52
47
find . -type d -name .git -prune -o -type f ! -name '*.c' ! -name '*.h' ! -name '*.mk' ! -name 'Makefile' -exec rm -rf {} +
56
51
git commit -m "[GH-BOT] Remove forbidden files and empty folders"
57
52
58
53
- name : Set version tag on evaluation branch
59
- if : steps.check_version.outputs .proceed == 'true'
54
+ if : env .proceed == 'true'
60
55
run : |
61
- EVAL_TAG="${{ steps.check_version.outputs.MAIN_TAG }}-eval"
56
+ EVAL_TAG="${{ env.main_tag }}-eval"
62
57
git tag "$EVAL_TAG"
63
58
git push origin evaluation "$EVAL_TAG"
0 commit comments