ci: avoid using the deprecated `set-env` construct
PATCH 1/1 ci: avoid using the deprecated `set-env` construct
From: Johannes Schindelin <[email protected]>
The set-env construct was deprecated as of the announcement in
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Let's use the recommended alternative instead.
---
ci: avoid using the deprecated set-env construct
This avoids an ugly warning (see e.g. this run
[https://github.com/gitgitgadget/git/actions/runs/350443139]).
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-781%2Fdscho%2Fno-set-env-in-github-workflows-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-781/dscho/no-set-env-in-github-workflows-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/781
.github/workflows/check-whitespace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
.github/workflows/check-whitespace.yml +1 -1
@@ -14,7 +14,7 @@ jobs: steps: - name: Set commit count shell: bash - run: echo "::set-env name=COMMIT_DEPTH::$((1+$COMMITS))" + run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV env: COMMITS: ${{ github.event.pull_request.commits }}
base-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d
Signature · 1 line
gitgitgadget
Looks good. Doing a similar change in a related repo.
...chris.
...chris.
[email protected]
webstech.com
Quoted 39 lines · Johannes Schindelin via GitGitGadget
From: Johannes Schindelin <[email protected]>
The
set-envconstruct was deprecated as of the announcement in
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/Let's use the recommended alternative instead.
Signed-off-by Johannes Schindelin <[email protected]>---
ci: avoid using the deprecated set-env constructThis avoids an ugly warning (see e.g. this run
[https://github.com/gitgitgadget/git/actions/runs/350443139]).Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-781%2Fdscho%2Fno-set-env-in-github-workflows-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-781/dscho/no-set-env-in-github-workflows-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/781.github/workflows/check-whitespace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-).github/workflows/check-whitespace.yml +1
-1@@ -14,7 +14,7 @@ jobs: steps: - name: Set commit count shell: bash - run: echo "::set-env name=COMMIT_DEPTH::$((1+$COMMITS))" + run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV env: COMMITS: ${{ github.event.pull_request.commits }}base-commit:
7f7ebe054af6d831b999d6c2241b9227c4e4e08d--
gitgitgadget
"Johannes Schindelin via GitGitGadget" <[email protected]>
Quoted 10 lines · writes:
From: Johannes Schindelin <[email protected]>
The
set-envconstruct was deprecated as of the announcement in
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
....github/workflows/check-whitespace.yml +0
-0
.github/workflows/check-whitespace.yml jobs: · line 19
Quoted 7 lines
.github/workflows/check-whitespace.yml +1
-1@@ -14,7 +14,7 @@ jobs: steps: - name: Set commit count shell: bash - run: echo "::set-env name=COMMIT_DEPTH::$((1+$COMMITS))" + run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV env: COMMITS: ${{ github.event.pull_request.commits }}
Do we need something similar for ci/print-test-failures.sh to prevent failures like https://github.com/git/git/runs/1409815807?
Perhaps like the following (which is copied-and-pasted without understanding what is going on or without doing nothing more than skimming [*1*])?
Reference
ci/print-test-failures.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ci/print-test-failures.sh +1 -1
@@ -48,7 +48,7 @@ do ;; github-actions) mkdir -p failed-test-artifacts - echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts" + echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/ tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" continue
Hi Junio,
Quoted 24 lines · Junio C Hamano
"Johannes Schindelin via GitGitGadget" <[email protected]>
Quoted 10 lines · writes:
From: Johannes Schindelin <[email protected]>
The
set-envconstruct was deprecated as of the announcement in
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
....github/workflows/check-whitespace.yml +0
-0.github/workflows/check-whitespace.yml jobs: · line 19
Quoted 7 lines
.github/workflows/check-whitespace.yml +1
-1@@ -14,7 +14,7 @@ jobs: steps: - name: Set commit count shell: bash - run: echo "::set-env name=COMMIT_DEPTH::$((1+$COMMITS))" + run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV env: COMMITS: ${{ github.event.pull_request.commits }}Do we need something similar for
ci/print-test-failures.shto prevent failures like https://github.com/git/git/runs/1409815807?
Quoted 3 lines
Perhaps like the following (which is copied-and-pasted without understanding what is going on or without doing nothing more than skimming [*1*])?
Yes, of course, this precisely what we need.
Sorry for not even _thinking_ about git grep set-env. This seems the only remaining use of that construct in our workflows, though.
Thanks,
Dscho
Quoted 25 lines
Reference
ci/print-test-failures.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)ci/print-test-failures.sh +1
-1@@ -48,7 +48,7 @@ do ;; github-actions) mkdir -p failed-test-artifacts - echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts" + echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/ tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" continue
Quoted 5 lines · Johannes Schindelin
Quoted 3 lines
Perhaps like the following (which is copied-and-pasted without understanding what is going on or without doing nothing more than skimming [*1*])?
Yes, of course, this precisely what we need.
Thanks.
--- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ------ >8 ---
Subject: [PATCH] ci: avoid set-env construct in print-test-failures.sh
Imitating cac42e47 (ci: avoid using the deprecated set-env construct, 2020-11-07), avoid deprecated ::set-env and use the recommended alternative instead in print-test-failures.sh
--- ci/print-test-failures.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ci/print-test-failures.sh +1 -1
@@ -48,7 +48,7 @@ do ;; github-actions) mkdir -p failed-test-artifacts - echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts" + echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/ tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" continue
Signature · 1 line
2.29.2-458-g8cf0a80384
Hi Junio,
Quoted 12 lines · Junio C Hamano
Quoted 5 lines · Johannes Schindelin
Quoted 3 lines
Perhaps like the following (which is copied-and-pasted without understanding what is going on or without doing nothing more than skimming [*1*])?
Yes, of course, this precisely what we need.
Thanks.
--- >8 ------ >8 ------ >8 --- cut here --- >8 ------ >8 ------ >8 ---
Quoted 8 lines
Subject: [PATCH] ci: avoid
set-envconstruct inprint-test-failures.shImitating
cac42e47(ci: avoid using the deprecatedset-envconstruct, 2020-11-07), avoid deprecated ::set-env and use the recommended alternative instead inprint-test-failures.shHelped-by Johannes Schindelin <[email protected]>Signed-off-by Junio C Hamano <[email protected]>
Thank you so much for tying up this loose end,
Dscho
Quoted 21 lines
--- ci/print-test-failures.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)ci/print-test-failures.sh +1
-2@@ -48,7 +48,7 @@ do ;; github-actions) mkdir -p failed-test-artifacts - echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts" + echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/ tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" continue --2.29.2-458-g8cf0a80384