Skip to content

Commit

Permalink
In-292 / IN-294 Updated reusable workflows for all orgs to have the e…
Browse files Browse the repository at this point in the history
…ncrypted JWT key included as default. Updated build-sfdx-project.yml to also include the encrypted prod JWT key for connecting to the Dev Hub.
  • Loading branch information
fransf-wtax committed Jul 3, 2023
1 parent 715d0fc commit 49903ed
Show file tree
Hide file tree
Showing 8 changed files with 703 additions and 76 deletions.
111 changes: 102 additions & 9 deletions .github/workflows/build-sfdx-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,109 @@ on:
description: OAuth client ID (sometimes called consumer key) of the connected app on Salesforce used to connect to the Dev Hub org
required: false
default: 3H7cm0QedwevwtVKpSJ4PXeI7kvPanBgB3qK0sBU06E5MSMka3xqeg9JETRkx8Z8PQxuZkUvlMJH10MQ8A9uw
username:
jwt-key-encrypted:
type: string
description: Username of Salesforce user to authenticate as; must have permission to create scratch orgs
description: Ansible Vault-encrypted private key to connect to the Dev Hub org with using the JWT flow (this should be encrypted using ansible-vault encrypt, NOT ansible-vault encrypt_string!)
required: false
default: [email protected]
jwt-key-file:
default: |
$ANSIBLE_VAULT;1.1;AES256
66626465343266336363626261646563303431326135373036343333386238323761373165346138
3164353437346165666439306165663635373364366233630a313361333534363735356665383262
63376636336462613066636633653037613566636235393864376236303865353836383535393831
3139313462313337310a623565353437376534666463396463363364393736636636393964663362
37326134396635616537363662306436346335323537623530613834323237343861316237356634
64386130333564313461393539613762616436313766303239653836623565656638323737313736
34313763396533656666343033313939613265303632656539613663326439336561393734663837
34346265396434353338353466393930663665653863346134643439396235313763393332306439
33313839663066613737373939386336656366643762626539343661626235616163316635626362
39356332356431616430643933303965393736663039356434393530373962616466653865313465
37616463386364613463656237383732393335616366353239653137626266333233373666633133
38623663386433373531643930626137333833353364653266653964326461666133353331363139
62353431303632343231376237613132396430356236656630666431623436663564656530383737
39356461333032623065653866653961353162626661376332626265353237343461343036353535
31636534663430336339373736663534346662333938623238653435643833333039633934663139
66356666333961643164306664333463376434323561396239616539326534646264323561616465
37626436393938303764376335343831643937306132363033316163613761663831353464336566
36383630643233323135653962316664393961376330646132303131303331303864373330363334
64336536333734383165623038393730366639386463616632396130356665373231636231653333
37323361326261653037666338353463383039393739353135346338626538363334353866303035
66636435376436363438323637616438323964303238323661373265313339636430386235346330
32373838386562623137356239666131666131616138633166623964303937623430343734633230
65653836313338396566386631363564653535623438653462663130373961323230363739656135
32643533323665386433656237313433653064303930363063343130613461336364323165613537
37623862313538313936333865636634376531323033666632313831343235616161363634313132
39366330306533333632383537356666623834313265613162313337303237303032303161616137
65393234386362316666386130663661343131353230633264333739623666343562323762303033
36636233353763313033366634336361303038636430646264663838316330373665353261353636
31333238353934386233636330336233643365663266333335633836376664366530616363376434
37336264663235356231633663383266653563646633386266336231613262333031666539303262
30646235383963376637383363653966616534383737613065323135663236323739356661346234
37353363643964623066333661303263616632613434393033373866623363326261633064633436
65393936336433336461636130333862326661643665316434306233613962383530396237636633
62636637386265666234323132386364636366343961656564343532633136393137636234373537
63383462373935346366303430613963366530646138616532303730633566356536653234633032
64313632306433333530326562613761313561336362383536343963363765333264343935343263
64316363376133373166343461656236356639663336363838396263663433363337613830616361
31623039613765303239643033386133636338393333623266636638353734303733313537363463
36323533303765363936666465663966376361643338323934363462393330386130313962663566
36643161396431323364663139313037653564626336366336663533623432313634383935316333
32343933633237396631383662346239346431396230303931333134366538633139623937333164
31323735663639623561333134383238363065306232646631346139326365316531386665633463
33313134343861346163313064373166393033646234336365653164303838313137366561323033
31383061623264366235306332613738333839366337613934366530653139393331623963326639
38633232623934653061613430396435656634363163316238336332383166366566373234383565
34336135353363303563393366306332396234326432633366333265323963323138613032383732
62376436386334313736376666633536353130343163306364636461613763303239313662633939
38646531633532643931363231373133343531656634303066333661366637373238646466643638
39376537326339323537623361373935323435373332366462303663656261373936616430663063
61636235366139613433343932366237666638353733313037326439616132393730323564636434
65316232313061393361306537343231346139373732396239363739373836623737343566333034
35353065336234383664613137316366333236633164346535623632363736643236626565643636
32646662336664396563353164393263333133633465376132393536376166373530646662656337
64636631663637663839373262643433643834353730383364346362663666653933653563373035
31626265623838336165653936353762313437346331616237663931313832643664393261376138
61333534643637393536313738613363356534333835613761363663363862316537353230646538
36356134313265393365363537313031323430313230333531643461623162613034373935623262
36366462373435613237623836333438353535353164316136376331363038346439613161303365
39313564643861623231336433343231356138643763306338396161323165373932386365613938
32643436303633666333353436363064613033393661313236663331373964623736613931653464
37616235373936623836343766356238343865373136646334373634353634643730613438373134
66333234663838323835663133333266346165663036383832343235616232326333376562643739
66396663356564303735653735623662336662346134653138386631386338363032353633386331
39623538613433336661356534313661376238303331633134633536356434346530643031326564
66666530623832383065636632653466383162616131323062363631366536643334323831383133
63646161366230643465353462306334313237306631613262633333373865346331313562353665
61306331303236323131386230616433663835346631663965336232326630316237343362633664
64393634323965383433623566333366643937663830353532373062313334616131353966623939
31613239363461643535626666653434666561633230313531393639353835373961393966353365
34613534333436343066613836346334393336653738303663643636333233653031363865623637
39323862303835393635363463336631373737373037353866633365356561333039373837633362
34646234366566313931316466343635626464613861353330663835323766343163656434336535
36313231336632623463363263393135326630653438303065626431306235383966386337333334
63386337313862333866336564306535366462666130663733356134633863323164666535373239
63613238656331376338313131356430656638366437653263613837353137386434383139326366
35383135383762333632613031303831383864323565323661643337353332333362313866663735
30363738326231383730656538323264346131353034356632396437643932313363396366363136
66376462313137666561376466353962316536373031373334356134663165633063613136613835
30336133356265373862336331656237383162623932323564333532393538353263633835643164
63643066386439393663363833366235316532623330326536616432643632316531326464656466
63366336313661323563306635303931643433393933613032303839393164326666646661633034
39343630613239316630383133636434663535613339336363303232353563363165393765666666
62393364643264393164643336363838326163316238373330623734383265373665616437316437
35636532643335663632613730333435383866343330666539633233633633306163663733326231
32633231613062646333396130633739316539643865313939306631393139656537616135623438
31636664653862336366316433393237313837363763396365366139396236613439616534313931
34306338373734633938393263323466383264323537343565633362636530363131623032653534
37353731663264653036323031353837646433343532396533316163656436306365636433313739
35336537366564393766343639653238396533313064393731656239323934663064
username:
type: string
description: Path to an Ansible Vault-encrypted file containing the private key to connect to the Dev Hub org with using the JWT flow
description: Username of Salesforce user to authenticate as on the Dev Hub org; must have permission to create scratch orgs
required: false
default: deploy/environments/prod/wtax-prod.key
default: admin@wtax.prod
secrets:
ansible-vault-password:
description: Password to be used to decrypt the `jwt-key-file`.
description: Password to be used to decrypt the `jwt-key-encrypted`.
required: true
jobs:
build:
Expand All @@ -41,11 +131,14 @@ jobs:
with:
node-version: 18.x

- name: write encrypted JWT key to file
run: echo "${{ inputs.jwt-key-encrypted }}" >.jwt-key

- name: write Ansible Vault password to file
run: echo "${{ secrets.ansible-vault-password }}" >.vault-password

- name: decrypt the private key for the Continuous Integration connected app
run: ansible-vault decrypt --vault-password-file=.vault-password ${{ inputs.jwt-key-file }}
run: ansible-vault decrypt --vault-password-file=.vault-password .jwt-key

- name: install Salesforce CLI (sfdx)
run: npm list -g sfdx-cli || npm install -g sfdx-cli
Expand All @@ -54,7 +147,7 @@ jobs:
run: |
sfdx auth:jwt:grant \
-i "${{ inputs.client-id }}" \
-f "${{ inputs.jwt-key-file }}" \
-f .jwt-key \
-r "${{ inputs.instance-url }}" \
-u "${{ inputs.username }}" -d
Expand Down
Loading

0 comments on commit 49903ed

Please sign in to comment.