Skip to content

Commit

Permalink
[#495] Remove template workflows when using template
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Aug 30, 2023
1 parent c37bd72 commit cc332c9
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions .github/project_workflows/publish_docs_to_wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish docs to Wiki

on:
push:
paths:
- .github/wiki/**
branches:
- main
- master

jobs:
publish_docs_to_wiki:
name: Publish Wiki
uses: nimblehq/github-actions-workflows/.github/workflows/[email protected]
with:
USER_NAME: team-nimblehq
USER_EMAIL: [email protected]
secrets:
USER_TOKEN: ${{ secrets.NIMBLE_DEV_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ extension FileManager {
}
}

func createFile(name: String, at directory: String) {
func createDirectory(path: String) {
let currentDirectory = currentDirectoryPath
do {
try createDirectory(atPath: "\(currentDirectory)/\(directory)", withIntermediateDirectories: true, attributes: nil)
try createDirectory(atPath: "\(currentDirectory)/\(path)", withIntermediateDirectories: true, attributes: nil)
} catch {
print("Error \(error)")
}
}

func createFile(name: String, at directory: String) {
let currentDirectory = currentDirectoryPath
createDirectory(path: directory)
createFile(atPath: "\(currentDirectory)\(directory)\(name)", contents: nil)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ struct SetUpCICDService {
print("Setting template for Github Actions")
fileManager.removeItems(in: "bitrise.yml")
fileManager.removeItems(in: "codemagic.yaml")
fileManager.removeItems(in: ".github/workflows")
fileManager.createDirectory(path: ".github/workflows")
fileManager.moveFiles(in: ".github/project_workflows", to: ".github/workflows")
fileManager.removeItems(in: ".github/project_workflows")
case .bitrise:
print("Setting template for Bitrise")
fileManager.removeItems(in: "codemagic.yaml")
Expand Down

0 comments on commit cc332c9

Please sign in to comment.