File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 description : ' Commit SHA to checkout'
1212 required : true
1313 type : string
14+ pr_number :
15+ description : ' PR number for commenting (optional, omit for merge runs)'
16+ required : false
17+ type : number
1418 secrets :
1519 AEM_USERNAME :
1620 required : true
@@ -158,3 +162,33 @@ jobs:
158162 -d "cmd=Activate" \
159163 -d "path=${cf_path}"
160164 echo "✅ CF replicated"
165+
166+ - name : Comment PR with staging link
167+ if : ${{ inputs.pr_number != 0 }}
168+ uses : actions/github-script@v7
169+ env :
170+ AEM_AUTHOR_URL : ${{ secrets.AEM_AUTHOR_URL }}
171+ with :
172+ script : |
173+ const skillName = '${{ inputs.skill_name }}';
174+ const cfPath = '/content/dam/snowflake-site/en/content-fragments/skills-library/' + skillName;
175+ const authorUrl = process.env.AEM_AUTHOR_URL;
176+ const cfLink = `${authorUrl}/ui#/aem/editor.html${cfPath}`;
177+
178+ const body = `## ✅ Skill Staged to AEM
179+
180+ **Skill:** \`${skillName}\`
181+
182+ 👉 **AEM Staging CF:** [Open in AEM Author](${cfLink})
183+
184+ > Content Fragment has been created/updated and replicated to the staging publish instance.
185+
186+ ---
187+ *Generated by GitHub Actions*`;
188+
189+ await github.rest.issues.createComment({
190+ owner : context.repo.owner,
191+ repo : context.repo.repo,
192+ issue_number : ${{ inputs.pr_number }},
193+ body
194+ });
Original file line number Diff line number Diff line change 99jobs :
1010 detect_changes :
1111 runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+ issues : write
15+ pull-requests : write
1216 outputs :
1317 skills_json : ${{ steps.detect.outputs.skills_json }}
1418 has_changes : ${{ steps.detect.outputs.has_changes }}
5660 with :
5761 skill_name : ${{ matrix.skill.name }}
5862 commit_sha : ${{ github.event.pull_request.head.sha }}
63+ pr_number : ${{ github.event.pull_request.number }}
5964 secrets :
6065 AEM_USERNAME : ${{ secrets.AEM_USERNAME_STAGING }}
6166 AEM_PASSWORD : ${{ secrets.AEM_PASSWORD_STAGING }}
You can’t perform that action at this time.
0 commit comments