@@ -130,12 +130,12 @@ test('diff() (travis)', function (t) {
130
130
131
131
return processor . process ( vfile ( { path : 'new.txt' , contents : other } ) )
132
132
} )
133
+ // Restore
134
+ . then ( restore , restore )
133
135
. then (
134
136
( ) => t . pass ( 'should pass' ) ,
135
137
( error ) => t . ifErr ( error , 'should not fail' )
136
138
)
137
- // Restore
138
- . then ( restore , restore )
139
139
140
140
function restore ( ) {
141
141
delete process . env . TRAVIS_COMMIT_RANGE
@@ -160,8 +160,6 @@ test('diff() (GitHub Actions)', function (t) {
160
160
t . plan ( 3 )
161
161
162
162
exec ( 'git init' )
163
- // Set up.
164
- . then ( ( ) => exec ( 'git config --global user.email' ) . catch ( setEmailAndName ) )
165
163
// Add initial file.
166
164
. then ( ( ) => vfile . write ( { path : 'example.txt' , contents : stepOne } ) )
167
165
. then ( ( ) => exec ( 'git add example.txt' ) )
@@ -210,16 +208,17 @@ test('diff() (GitHub Actions)', function (t) {
210
208
)
211
209
} )
212
210
// Restore
211
+ . then ( restore , restore )
213
212
. then (
214
213
( ) => t . pass ( 'should pass' ) ,
215
214
( error ) => t . ifErr ( error , 'should not fail' )
216
215
)
217
- . then ( restore , restore )
218
216
219
217
function restore ( ) {
220
- return rimraf ( '.git' )
221
- . then ( ( ) => rimraf ( 'new.txt' ) )
222
- . then ( ( ) => rimraf ( 'example.txt' ) )
218
+ delete process . env . GITHUB_SHA
219
+ delete process . env . GITHUB_BASE_REF
220
+ delete process . env . GITHUB_HEAD_REF
221
+ return rimraf ( '.git' ) . then ( ( ) => rimraf ( 'example.txt' ) )
223
222
}
224
223
} )
225
224
0 commit comments