@@ -19,29 +19,51 @@ jobs:
1919 id-token : write
2020 contents : read
2121 steps :
22- - name : Get GH app token
23- id : gh-app-token
24- uses : cloudbeds/composite-actions/gh-app-token@v2
22+ - name : Configure AWS credentials
23+ uses : aws-actions/configure-aws-credentials@v4
24+ with :
25+ role-to-assume : arn:aws:iam::048781935247:role/GH-APP-OIDC-CBMyFrontDesk
26+ aws-region : us-west-2
27+
28+ - name : Get app private key from SSM and apply mask
29+ id : app-private-key
30+ shell : bash
31+ run : |
32+ aws ssm get-parameter --name /github/app/CBMyFrontDesk/private-key --output text --with-decryption --query Parameter.Value > private.key
33+ {
34+ echo "key<<EOF"
35+ cat private.key
36+ echo "EOF"
37+ } >> $GITHUB_OUTPUT
38+ while read -r line;
39+ do
40+ if [[ -n "${line}" ]]; then
41+ echo "::add-mask::${line}"
42+ fi
43+ done < private.key
44+ rm private.key
45+
46+ - name : Generate token
47+ id : generate-token
48+ uses : tibdex/github-app-token@v2
2549 with :
2650 app_id : 391670
27- aws_role_arn : arn:aws:iam::048781935247:role/GH-APP-OIDC-CBMyFrontDesk
28- aws_ssm_param_name : /github/app/CBMyFrontDesk/private-key
51+ private_key : ${{ steps.app-private-key.outputs.key }}
2952
3053 - name : Checkout code
3154 uses : actions/checkout@v4
3255 with :
33- token : ${{ steps.gh-app- token.outputs.github- token }}
56+ token : ${{ steps.generate- token.outputs.token }}
3457
3558 - name : Get API docs
3659 env :
37- GITHUB_TOKEN : ${{ steps.gh-app- token.outputs.github- token }}
60+ GITHUB_TOKEN : ${{ steps.generate- token.outputs.token }}
3861 run : |
3962 MFD_TAG=$(gh api /repos/cloudbeds/mfd/releases/latest | jq -r '.tag_name')
4063 echo "Latest MFD tag: $MFD_TAG"
4164 gh api /repos/cloudbeds/mfd/tarball/$MFD_TAG | tar --strip-components=1 --wildcards -zxf - '*/public_accessa/api'
4265
4366 - name : Get next version
44- id : get_next_version
4567 run : |
4668 if [ -n "${{ inputs.version }}" ]; then
4769 echo "next_version=${{ inputs.version }}" >> $GITHUB_ENV
@@ -122,7 +144,6 @@ jobs:
122144 path : dist/
123145
124146 - name : Create Release
125- id : create_release
126147 if : inputs.version == ''
127148 env :
128149 GITHUB_TOKEN : ${{ github.token }}
0 commit comments