mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
[RDNF #11] fix: skipped jobs have no result & fix: favor command-line over files & chore: fix some comments (#143)
https://github.com/nektos/act/pull/2274 https://github.com/nektos/act/pull/2276 https://github.com/nektos/act/pull/2279 Co-authored-by: lvyaoting <166296299+lvyaoting@users.noreply.github.com> Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: ChristopherHX <christopher.homberger@web.de> Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/143 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org> Co-authored-by: achyrva <achyrva@noreply.code.forgejo.org> Co-committed-by: achyrva <achyrva@noreply.code.forgejo.org>
This commit is contained in:
parent
422e17bc27
commit
4880b091a2
4 changed files with 8 additions and 5 deletions
|
@ -853,7 +853,7 @@ class Summary {
|
||||||
/**
|
/**
|
||||||
* If the summary buffer is empty
|
* If the summary buffer is empty
|
||||||
*
|
*
|
||||||
* @returns {boolen} true if the buffer is empty
|
* @returns {boolean} true if the buffer is empty
|
||||||
*/
|
*/
|
||||||
isEmptyBuffer() {
|
isEmptyBuffer() {
|
||||||
return this._buffer.length === 0;
|
return this._buffer.length === 0;
|
||||||
|
@ -1840,7 +1840,7 @@ class Pattern {
|
||||||
// Normalize slashes
|
// Normalize slashes
|
||||||
itemPath = pathHelper.normalizeSeparators(itemPath);
|
itemPath = pathHelper.normalizeSeparators(itemPath);
|
||||||
// Append a trailing slash. Otherwise Minimatch will not match the directory immediately
|
// Append a trailing slash. Otherwise Minimatch will not match the directory immediately
|
||||||
// preceeding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
|
// preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
|
||||||
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
|
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
|
||||||
if (!itemPath.endsWith(path.sep)) {
|
if (!itemPath.endsWith(path.sep)) {
|
||||||
// Note, this is safe because the constructor ensures the pattern has an absolute root.
|
// Note, this is safe because the constructor ensures the pattern has an absolute root.
|
||||||
|
|
|
@ -914,7 +914,8 @@ func (rc *RunContext) isEnabled(ctx context.Context) (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !runJob {
|
if !runJob {
|
||||||
l.WithField("jobResult", "skipped").Infof("Skipping job '%s' due to '%s'", job.Name, job.If.Value)
|
rc.result("skipped")
|
||||||
|
l.WithField("jobResult", "skipped").Debugf("Skipping job '%s' due to '%s'", job.Name, job.If.Value)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -314,7 +314,7 @@ func TestIsContinueOnError(t *testing.T) {
|
||||||
assertObject.False(continueOnError)
|
assertObject.False(continueOnError)
|
||||||
assertObject.Nil(err)
|
assertObject.Nil(err)
|
||||||
|
|
||||||
// explcit true
|
// explicit true
|
||||||
step = createTestStep(t, "continue-on-error: true")
|
step = createTestStep(t, "continue-on-error: true")
|
||||||
continueOnError, err = isContinueOnError(context.Background(), step.getStepModel().RawContinueOnError, step, stepStageMain)
|
continueOnError, err = isContinueOnError(context.Background(), step.getStepModel().RawContinueOnError, step, stepStageMain)
|
||||||
assertObject.True(continueOnError)
|
assertObject.True(continueOnError)
|
||||||
|
|
|
@ -333,8 +333,10 @@ func readEnvs(path string, envs map[string]string) bool {
|
||||||
log.Fatalf("Error loading from %s: %v", path, err)
|
log.Fatalf("Error loading from %s: %v", path, err)
|
||||||
}
|
}
|
||||||
for k, v := range env {
|
for k, v := range env {
|
||||||
|
if _, ok := envs[k]; !ok {
|
||||||
envs[k] = v
|
envs[k] = v
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue