mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[github] IJPL-74106 Added navigation to workflow files. Using naive algorithm to detect actions and workflows
GitOrigin-RevId: 92018dfc270bad4f5622032894f136b274448130
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2e4f6c55a5
commit
79562e04d2
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.github.extensions
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtilRt
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.openapi.vfs.isFile
|
||||
import com.intellij.psi.PsiFile
|
||||
@@ -20,16 +21,16 @@ fun isGithubWorkflowFile(psiFile: PsiFile?): Boolean {
|
||||
}
|
||||
|
||||
private fun isGithubActionsActionFile(virtualFile: VirtualFile): Boolean {
|
||||
val nameSequence = virtualFile.nameSequence
|
||||
val fileName = virtualFile.name
|
||||
return virtualFile.isFile
|
||||
&& (nameSequence.endsWith(".yaml") || nameSequence.endsWith(".yml"))
|
||||
&& (FileUtilRt.extensionEquals(fileName, "yml") || FileUtilRt.extensionEquals(fileName, "yaml"))
|
||||
&& virtualFile.nameWithoutExtension == "action"
|
||||
}
|
||||
|
||||
private fun isGithubWorkflowFile(virtualFile: VirtualFile): Boolean {
|
||||
val nameSequence = virtualFile.nameSequence
|
||||
val fileName = virtualFile.name
|
||||
return virtualFile.isFile
|
||||
&& (nameSequence.endsWith(".yaml") || nameSequence.endsWith(".yml"))
|
||||
&& (FileUtilRt.extensionEquals(fileName, "yml") || FileUtilRt.extensionEquals(fileName, "yaml"))
|
||||
&& virtualFile.parent?.name == "workflows"
|
||||
&& virtualFile.parent?.parent?.name == ".github"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user