Skip to content

Commit 1f3ef6f

Browse files
committed
fix: inline org action that gets a token for aws
1 parent 627f1e7 commit 1f3ef6f

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.github/workflows/publish.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,34 @@ 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+
echo "APP_PRIVATE_KEY<<EOF" >> $GITHUB_ENV
34+
cat private.key >> $GITHUB_ENV
35+
echo "EOF" >> $GITHUB_ENV
36+
while read -r line;
37+
do
38+
if [[ -n "${line}" ]]; then
39+
echo "::add-mask::${line}"
40+
fi
41+
done < private.key
42+
rm private.key
43+
44+
- name: Generate token
45+
id: generate_token
46+
uses: tibdex/github-app-token@v2
2547
with:
2648
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
49+
private_key: ${{ env.APP_PRIVATE_KEY }}
2950

3051
- name: Checkout code
3152
uses: actions/checkout@v4

0 commit comments

Comments
 (0)