Skip to content

Commit 9c406d3

Browse files
committed
fix: use app token instead of action token so we can push to main branch
1 parent e50e777 commit 9c406d3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,41 @@ jobs:
1919
id-token: write
2020
contents: read
2121
steps:
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
49+
with:
50+
app_id: 391670
51+
private_key: ${{ steps.app-private-key.outputs.key }}
52+
2253
- name: Checkout code
2354
uses: actions/checkout@v4
55+
with:
56+
token: ${{ steps.generate-token.outputs.token }}
2457

2558
- name: Get API docs
2659
run: |

0 commit comments

Comments
 (0)