Skip to content

Commit ab05336

Browse files
committed
cd: Use GITHUB_ENV instead of GITHUB_OUTPUT
GITHUB_ENV is meant for the scope of a job, while GITHUB_OUTPUT is meant for the scope of multiple jobs. https://github.com/orgs/community/discussions/55294#discussioncomment-5884935
1 parent 20db7fb commit ab05336

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

.github/workflows/delivery.yaml

+7-12
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ on:
88
jobs:
99
cleanup_and_merge:
1010
runs-on: ubuntu-latest
11-
outputs:
12-
proceed: ${{ steps.check_version.outputs.PROCEED }}
13-
main_tag: ${{ steps.check_version.outputs.MAIN_TAG }}
1411

1512
steps:
1613
- name: Checkout code
@@ -24,29 +21,27 @@ jobs:
2421
git config --local user.name "Lea Yeh"
2522
2623
- name: Check tag version
27-
id: check_version
2824
run: |
2925
MAIN_TAG=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null) || true
3026
if [[ $(git tag --contains origin/evaluation | wc -l) -gt 0 ]]; then
3127
EVAL_TAG=$(git describe --tags `git rev-list --tags --remotes=origin/evaluation --max-count=1` 2>/dev/null) || true
3228
fi
3329
echo "MAIN_TAG: $MAIN_TAG"
3430
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"
3732
if [[ "$MAIN_TAG" > "$EVAL_TAG" ]]; then
38-
echo "PROCEED=true" >> "$GITHUB_OUTPUT"
33+
echo "proceed=true" >> "$GITHUB_ENV"
3934
else
40-
echo "PROCEED=false" >> "$GITHUB_OUTPUT"
35+
echo "proceed=false" >> "$GITHUB_ENV"
4136
fi
4237
4338
- name: Setup evaluation branch
44-
if: steps.check_version.outputs.proceed == 'true'
39+
if: env.proceed == 'true'
4540
run: |
4641
git checkout -b evaluation 2>/dev/null || git checkout evaluation
4742
4843
- name: Merge and delete forbidden files and commit
49-
if: steps.check_version.outputs.proceed == 'true'
44+
if: env.proceed == 'true'
5045
run: |
5146
git merge origin/main
5247
find . -type d -name .git -prune -o -type f ! -name '*.c' ! -name '*.h' ! -name '*.mk' ! -name 'Makefile' -exec rm -rf {} +
@@ -56,8 +51,8 @@ jobs:
5651
git commit -m "[GH-BOT] Remove forbidden files and empty folders"
5752
5853
- name: Set version tag on evaluation branch
59-
if: steps.check_version.outputs.proceed == 'true'
54+
if: env.proceed == 'true'
6055
run: |
61-
EVAL_TAG="${{ steps.check_version.outputs.MAIN_TAG }}-eval"
56+
EVAL_TAG="${{ env.main_tag }}-eval"
6257
git tag "$EVAL_TAG"
6358
git push origin evaluation "$EVAL_TAG"

0 commit comments

Comments
 (0)