Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseGaud committed Oct 30, 2024
1 parent ed3c595 commit 83ce334
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 26 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/t1-failure-no-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
jobs:
testJob:
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:not-a-tag",
]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-failure-no-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
jobs:
testJob:
runs-on: [
"self-hosted",
"anka",
"anka-template:c092c6f6-198c-470f-9526-9c998efe7ab5",
"anka-template-tag:vanilla+port-forward-22+brew-git",
]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-failure-tag-1-in-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
jobs:
testJob:
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22+brew-git",
]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-with-tag-1-matrix-nodes-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
matrix:
node: ["1", "2"]
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22+brew-git",
"unique-id:${{ github.run_id }}-${{ matrix.node }}",
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-with-tag-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
jobs:
t1-with-tag-1:
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22+brew-git",
]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-with-tag-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
jobs:
testJob:
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22",
]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/t1-without-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
jobs:
testJob:
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
]
steps:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/t2-dual-without-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
jobs:
testJob:
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
]
steps:
Expand All @@ -18,8 +16,6 @@ jobs:
echo "123"
testJob2:
runs-on: [
"self-hosted",
"anka",
"anka-template:6abae54f-025d-4a27-b5eb-b985d5eddac9",
]
steps:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.3
0.9.0
2 changes: 0 additions & 2 deletions plugins/handlers/github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ on:
jobs:
testJob:
runs-on: [
"self-hosted",
"anka",
"anka-template:d792c6f6-198c-470f-9526-9c998efe7ab4",
"anka-template-tag:vanilla+port-forward-22+brew-git",
]
Expand Down
12 changes: 7 additions & 5 deletions plugins/receivers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ func NewServer(port string) *Server {
}
}

func exists_in_array_exact(array_to_search_in []string, desired []string) bool {
func exists_in_array_partial(array_to_search_in []string, desired []string) bool {
for _, desired_string := range desired {
found := false
for _, item := range array_to_search_in {
if item == desired_string {
if strings.Contains(item, desired_string) {
found = true
break
}
Expand Down Expand Up @@ -203,9 +203,11 @@ func Run(
"workflowJob.Action", *workflowJob.Action,
"workflowJob.WorkflowJob.Labels", workflowJob.WorkflowJob.Labels,
"workflowJob.WorkflowJob.ID", *workflowJob.WorkflowJob.ID,
"workflowJob.WorkflowJob.Name", *workflowJob.WorkflowJob.Name,
"workflowJob.WorkflowJob.RunID", *workflowJob.WorkflowJob.RunID,
)
if *workflowJob.Action == "queued" {
if exists_in_array_exact(workflowJob.WorkflowJob.Labels, []string{"self-hosted", "anka"}) {
if exists_in_array_partial(workflowJob.WorkflowJob.Labels, []string{"anka-template"}) {
// make sure it doesn't already exist
inQueue, err := InQueue(pluginCtx, logger, *workflowJob.WorkflowJob.ID, "anklet/jobs/github/queued/"+ctxPlugin.Owner)
if err != nil {
Expand Down Expand Up @@ -241,7 +243,7 @@ func Run(
}
}
} else if *workflowJob.Action == "completed" {
if exists_in_array_exact(workflowJob.WorkflowJob.Labels, []string{"self-hosted", "anka"}) {
if exists_in_array_partial(workflowJob.WorkflowJob.Labels, []string{"anka-template"}) {

queues := []string{}
// get all keys from database for the main queue and service queues as well as completed
Expand Down Expand Up @@ -431,7 +433,7 @@ func Run(
doneWithHooks = true
break
}
if !exists_in_array_exact(workflowJobEvent.WorkflowJob.Labels, []string{"self-hosted", "anka"}) {
if !exists_in_array_partial(workflowJobEvent.WorkflowJob.Labels, []string{"anka-template"}) {
continue
}
allHooks = append(allHooks, map[string]interface{}{
Expand Down

0 comments on commit 83ce334

Please sign in to comment.