selective-ruby-core 0.2.3-arm64-darwin → 0.2.5-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65a9d5ea2fc988fb01cc1966ec4eea098a9149593b0217fea94e74d8dfb9191d
4
- data.tar.gz: c6c330b10973b8d83ee8ae51947e22b1cbe0bb2893c7beaf340f4dd91deed152
3
+ metadata.gz: c39a8b22cd9d49f69586e97dfd42a74336e09e3a87f39ce46e6bf84c2c3deec7
4
+ data.tar.gz: 99d689604784f00472077d21edf2bf00d2634fd08f2fb5ad687be82a504c674a
5
5
  SHA512:
6
- metadata.gz: 14788a8944552736e727242a3be3b5eb8240523f4b7b881836cc9ff95a00814fac741e6756a4a25b153439dece54c02e76732998dc282d7f4a6b07df50c4c15d
7
- data.tar.gz: cdb477933ff7b2ebf328efc0ac5aa88bfaccdde6a4e7fe0ef27a6ac83256837596808fe3393d06fcb31d564b712c29a8d1caf40ad100aa104949c995f306f5a4
6
+ metadata.gz: 50652db694da6a0b5bf0664b40b4e9a4534b20c4264202fa56e5a78f981141bcae0d20f467d662003444cabf1fd04e2c37fec2e7d96126e8a910fd5c3bcaaca7
7
+ data.tar.gz: 39297fcbdc96591d33c3bb92087c3d7a63b84dbf73e07f91f72294b61c03aa374ea49c80a2cb633d3bc4fdb07b3fbf031a2c1d12dcd2583651513b9f1c6e0954
data/lib/bin/build_env.sh CHANGED
@@ -10,6 +10,9 @@ if [ -n "$GITHUB_ACTIONS" ]; then
10
10
  run_id=$GITHUB_RUN_ID
11
11
  run_attempt=$GITHUB_RUN_ATTEMPT
12
12
  runner_id=$SELECTIVE_RUNNER_ID
13
+ commit_message=$(git log --format=%s -n 1 $sha)
14
+ committer_name=$(git show -s --format='%an' -n 1 $sha)
15
+ committer_email=$(git show -s --format='%ae' -n 1 $sha)
13
16
  elif [ -n "$CIRCLECI" ]; then
14
17
  platform=circleci
15
18
  branch=$CIRCLE_BRANCH
@@ -17,6 +20,9 @@ elif [ -n "$CIRCLECI" ]; then
17
20
  sha=$CIRCLE_SHA1
18
21
  run_attempt=$CIRCLE_BUILD_NUM
19
22
  runner_id=$CIRCLE_NODE_INDEX
23
+ commit_message=$(git log --format=%s -n 1 $sha)
24
+ committer_name=$(git show -s --format='%an' -n 1 $sha)
25
+ committer_email=$(git show -s --format='%ae' -n 1 $sha)
20
26
  elif [ -n "$SEMAPHORE" ]; then
21
27
  platform=semaphore
22
28
  branch=${SEMAPHORE_GIT_PR_BRANCH:-$SEMAPHORE_GIT_BRANCH}
@@ -29,24 +35,45 @@ elif [ -n "$SEMAPHORE" ]; then
29
35
  run_attempt=1
30
36
  runner_id=$SEMAPHORE_JOB_ID
31
37
  pr_title=$SEMAPHORE_GIT_PR_NAME
38
+ commit_message=$(git log --format=%s -n 1 $sha)
39
+ committer_name=$(git show -s --format='%an' -n 1 $sha)
40
+ committer_email=$(git show -s --format='%ae' -n 1 $sha)
41
+ elif [ -n "$MINT" ]; then
42
+ platform=mint
43
+ branch="${MINT_GIT_REF_NAME}"
44
+ actor="${MINT_ACTOR}"
45
+ sha="${MINT_GIT_COMMIT_SHA}"
46
+ run_id="${MINT_RUN_ID}"
47
+ run_attempt="${MINT_TASK_ATTEMPT_NUMBER}"
48
+ runner_id="${MINT_PARALLEL_INDEX}"
49
+ # Mint does not preserve the .git directory by default to improve the likelihood of cache hits. Instead
50
+ # of asking git for commit information, then, we rely on the mint/git-clone leaf to populate the necessary
51
+ # metadata in environment variables.
52
+ commit_message="${MINT_GIT_COMMIT_SUMMARY}"
53
+ committer_name="${MINT_GIT_COMMITTER_NAME}"
54
+ committer_email="${MINT_GIT_COMMITTER_EMAIL}"
32
55
  fi
33
56
 
57
+ function escape() {
58
+ echo -n "$1" | sed 's/"/\\"/g'
59
+ }
60
+
34
61
  # Output the JSON
35
62
  cat <<EOF
36
63
  {
37
- "api_key": "$SELECTIVE_API_KEY",
38
- "host": "${SELECTIVE_HOST:-wss://app.selective.ci}",
39
- "platform": "${SELECTIVE_PLATFORM:-$platform}",
40
- "branch": "${SELECTIVE_BRANCH:-$branch}",
41
- "pr_title": "${SELECTIVE_PR_TITLE:-$pr_title}",
42
- "target_branch": "${SELECTIVE_TARGET_BRANCH:-$target_branch}",
43
- "actor": "${SELECTIVE_ACTOR:-$actor}",
44
- "sha": "${SELECTIVE_SHA:-$sha}",
45
- "run_id": "${SELECTIVE_RUN_ID:-$run_id}",
46
- "run_attempt": "${SELECTIVE_RUN_ATTEMPT:-$run_attempt}",
47
- "runner_id": "${SELECTIVE_RUNNER_ID:-$runner_id}",
48
- "commit_message": "$(git log --format=%s -n 1 $sha)",
49
- "committer_name": "$(git show -s --format='%an' -n 1 $sha)",
50
- "committer_email": "$(git show -s --format='%ae' -n 1 $sha)"
64
+ "api_key": "$(escape "${SELECTIVE_API_KEY}")",
65
+ "host": "$(escape "${SELECTIVE_HOST:-wss://app.selective.ci}")",
66
+ "platform": "$(escape "${SELECTIVE_PLATFORM:-$platform}")",
67
+ "branch": "$(escape "${SELECTIVE_BRANCH:-$branch}")",
68
+ "pr_title": "$(escape "${SELECTIVE_PR_TITLE:-$pr_title}")",
69
+ "target_branch": "$(escape "${SELECTIVE_TARGET_BRANCH:-$target_branch}")",
70
+ "actor": "$(escape "${SELECTIVE_ACTOR:-$actor}")",
71
+ "sha": "$(escape "${SELECTIVE_SHA:-$sha}")",
72
+ "run_id": "$(escape "${SELECTIVE_RUN_ID:-$run_id}")",
73
+ "run_attempt": "$(escape "${SELECTIVE_RUN_ATTEMPT:-$run_attempt}")",
74
+ "runner_id": "$(escape "${SELECTIVE_RUNNER_ID:-$runner_id}")",
75
+ "commit_message": "$(escape "${SELECTIVE_COMMIT_MESSAGE:-$commit_message}")",
76
+ "committer_name": "$(escape "${SELECTIVE_COMMITTER_NAME:-$committer_name}")",
77
+ "committer_email": "$(escape "${SELECTIVE_COMMITTER_EMAIL:-$committer_email}")"
51
78
  }
52
- EOF
79
+ EOF
data/lib/bin/transport CHANGED
Binary file
@@ -3,7 +3,7 @@
3
3
  module Selective
4
4
  module Ruby
5
5
  module Core
6
- VERSION = "0.2.3"
6
+ VERSION = "0.2.5"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selective-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Benjamin Wood
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-02-06 00:00:00.000000000 Z
12
+ date: 2024-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: zeitwerk
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
74
- rubygems_version: 3.4.10
74
+ rubygems_version: 3.5.3
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Selective Ruby Client Core