Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfc96980

Browse files
committed
Have init script check for GitHub Actions
As well as still checking for Travis, for backward compatibilityand because experience shows that this is safe.The check can be much broader, and would be more accurate, withfewer false negatives. But a false positive can result in localdata loss because the script does hard resets on CI withoutprompting for confirmation. So for now, this just checks $TRAVISand $GITHUB_ACTIONS.Now that GHA is included, the CI workflows no longer need to set$TRAVIS when running the script, so that is removed.
1 parentf094909 commitfc96980

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

‎.github/workflows/cygwin-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
4141
-name:Prepare this repo for tests
4242
run:|
43-
TRAVIS=yes./init-tests-after-clone.sh
43+
./init-tests-after-clone.sh
4444
4545
-name:Set git user identity and command aliases for the tests
4646
run:|

‎.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
-name:Prepare this repo for tests
3939
run:|
40-
TRAVIS=yes./init-tests-after-clone.sh
40+
./init-tests-after-clone.sh
4141
4242
-name:Set git user identity and command aliases for the tests
4343
run:|

‎init-tests-after-clone.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
set -eu
44

5-
iftest -z"${TRAVIS-}";then
5+
ci() {
6+
# For now, check just these, as a false positive could lead to data loss.
7+
test -n"${TRAVIS-}"||test -n"${GITHUB_ACTIONS-}"
8+
}
9+
10+
if! ci;then
611
printf'This operation will destroy locally modified files. Continue ? [N/y]:'>&2
712
read -r answer
813
case"$answer"in
@@ -29,7 +34,7 @@ git reset --hard HEAD~1
2934
git reset --hard __testing_point__
3035

3136
# Do some setup that CI takes care of but that may not have been done locally.
32-
iftest -z"${TRAVIS-}";then
37+
if! ci;then
3338
# The tests need some version tags. Try to get them even in forks.
3439
git fetch --all --tags
3540

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp