Skip to content

Commit 05bb152

Browse files
committed
chore: adds org selecting
1 parent 79ee116 commit 05bb152

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

blueprint.cue

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ci: {
1616
provider: "aws"
1717
path: "global/ci/earthly"
1818
}
19+
org: "Catalyst"
1920
satellite: "ci"
2021
}
2122
}

blueprint/schema/_embed/schema.cue

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ package schema
6969
// +optional
7070
credentials?: #Secret @go(Credentials)
7171

72+
// Org specifies the Earthly Cloud organization to use.
73+
// +optional
74+
org?: null | string @go(Org,*string)
75+
7276
// Satellite contains the satellite to use for caching.
7377
// +optional
7478
satellite?: null | string @go(Satellite,*string)

blueprint/schema/schema.go

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ type ProviderEarthly struct {
7575
// +optional
7676
Credentials Secret `json:"credentials"`
7777

78+
// Org specifies the Earthly Cloud organization to use.
79+
// +optional
80+
Org *string `json:"org"`
81+
7882
// Satellite contains the satellite to use for caching.
7983
// +optional
8084
Satellite *string `json:"satellite"`

blueprint/schema/schema_go_gen.cue

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ package schema
6969
// +optional
7070
credentials?: #Secret @go(Credentials)
7171

72+
// Org specifies the Earthly Cloud organization to use.
73+
// +optional
74+
org?: null | string @go(Org,*string)
75+
7276
// Satellite contains the satellite to use for caching.
7377
// +optional
7478
satellite?: null | string @go(Satellite,*string)

forge/actions/setup/action.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
uses: actions/cache@v4
2424
with:
2525
path: /usr/local/bin/forge
26-
key: ${{ runner.os }}-forge-${{ hashFiles('forge/cli/**') }}
26+
key: ${{ runner.os }}-forge-${{ hashFiles('forge/cli/**', 'blueprint/**') }}
2727
restore-keys: |
2828
${{ runner.os }}-forge-
2929
- name: Build Forge CLI
@@ -97,8 +97,13 @@ runs:
9797
run: |
9898
BP=$(forge blueprint dump .)
9999
100-
EARTHLY=$(echo "$BP" | jq -r .ci.providers.earthly.credentials)
100+
EARTHLY=$(echo "$BP" | jq -r .ci.providers.earthly)
101101
if [[ "$EARTHLY" != "null" ]]; then
102+
ORG=$(echo "$BP" | jq -r .ci.providers.earthly.org)
103+
fi
104+
105+
EARTHLY_CREDS=$(echo "$BP" | jq -r .ci.providers.earthly.credentials)
106+
if [[ "$EARTHLY_CREDS" != "null" ]]; then
102107
SECRET=$(forge secret get -b . ci.providers.earthly.credentials)
103108
TOKEN=$(echo "$SECRET" | jq -r .token)
104109
@@ -108,14 +113,20 @@ runs:
108113
fi
109114
fi
110115
116+
echo "org=$ORG" >> $GITHUB_OUTPUT
117+
111118
echo "::add-mask::$TOKEN"
112119
echo "token=$TOKEN" >> $GITHUB_OUTPUT
113120
- name: Login to Earthly Cloud
114121
if: steps.earthly.outputs.token != ''
115122
shell: bash
116123
run: |
117124
earthly account login --token "${{ steps.earthly.outputs.token }}"
118-
125+
- name: Set Earthly organization
126+
if: steps.earthly.outputs.org != ''
127+
shell: bash
128+
run: |
129+
earthly org select "${{ steps.earthly.outputs.org }}""
119130
- name: Testing
120131
shell: bash
121132
run: |

0 commit comments

Comments
 (0)