Skip to content

Commit

Permalink
serktjgh
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynne committed Oct 14, 2023
1 parent 0716445 commit 53598ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .github/actions/generate-swift-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,12 @@ runs:
id: graph
env:
PROJ: ${{ inputs.path || github.workspace }}
REPO_SPEC: ${{ inputs.repository || github.repository }}
BRANCH: ${{ inputs.branch || github.ref }}
COMMIT: ${{ inputs.commit || github.sha }}
TOKEN: ${{ inputs.token || github.token }}
CORRELATOR: ${{ format('{0}-{1}-{2}-{3}', github.workflow_ref, github.job, github.action, runner.os) }}
RUN_ID: ${{ github.run_id }}
shell: bash
run: |
export OWNER="${REPO_SPEC%%/*}" REPO="${REPO_SPEC#*/}"
json1="$(swift package --package-path "${PROJ}" --skip-update --force-resolved-versions show-dependencies --format json)"
echo "${json1}"
json2="$(echo "${json1}" | "${GITHUB_ACTION_PATH}/convert-dependency-graph.swift")"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ struct GithubDependencyGraph: Codable {
}
let name: String, file: File, resolved: [String: Package]
}
let owner: String, repo: String, version: Int, sha: String, ref: String,
job: Job, detector: Detector, scanned: Date, manifests: [String: Manifest]
let version: Int, sha: String, ref: String, job: Job, detector: Detector,
scanned: Date, manifests: [String: Manifest]
}

func env(_ name: String) -> String {
Expand All @@ -58,9 +58,8 @@ func main() {
encoder.dateEncodingStrategy = .iso8601
encoder.outputFormatting = [.withoutEscapingSlashes, .sortedKeys]

let owner = env("OWNER"), repo = env("REPO"), branch = env("BRANCH"),
commit = env("COMMIT"), correlator = env("CORRELATOR"), runId = env("RUN_ID"),
detector = env("GITHUB_ACTION"), detectorVer = env("GITHUB_ACTION_REF"),
let branch = env("BRANCH"), commit = env("COMMIT"), correlator = env("CORRELATOR"),
runId = env("RUN_ID"), detector = env("GITHUB_ACTION"), detectorVer = env("GITHUB_ACTION_REF"),
detectorRepo = env("GITHUB_ACTION_REPOSITORY"), serverUrl = env("GITHUB_SERVER_URL")

let dependencies = try! decoder.decode(
Expand Down Expand Up @@ -89,7 +88,7 @@ func main() {
handleDeps(dependencies)

let graph = GithubDependencyGraph(
owner: owner, repo: repo, version: 0, sha: commit, ref: branch,
version: 0, sha: commit, ref: branch,
job: .init(correlator: correlator, id: runId),
detector: .init(
name: .init(detector.drop(while: { $0 == "_" }).prefix(while: { $0 != "_" })),
Expand Down

0 comments on commit 53598ee

Please sign in to comment.