-
Notifications
You must be signed in to change notification settings - Fork 44
37 lines (36 loc) · 1.18 KB
/
update-importmaps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Update import maps
on:
pull_request:
branches:
- 'main'
jobs:
build:
if: startsWith(github.head_ref, 'r-')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Configure Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Install dependencies
run: npm install
- name: Update import maps
run: tools/imports.sh
- name: Commit changes
run: |
git add -A
git commit -m "chore(oversight): update import maps"
git push origin HEAD:${{ github.head_ref }}
- name: Update PR comment to include aem.live test URL
run: |
OLD_BODY=$(gh pr view --json body --jq ".body")
BRANCH_NAME=$(echo ${{ github.head_ref }})
NEW_BODY="$OLD_BODY\n\nTest at: https://$BRANCH_NAME--helix-website--adobe.aem.live/tools/oversight/explorer.html?domain=www.emigrationbrewing.com"
gh pr edit ${{ github.event.number }} --body "$NEW_BODY"