Update snapshot-release.yml

This commit is contained in:
Fred K. Schott 2022-09-12 14:30:58 -07:00 committed by GitHub
parent 8031ef8039
commit 05778251db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,17 +29,15 @@ jobs:
- name: Extract the snapshot name from comment body
id: getSnapshotName
uses: actions/github-script@v6
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
with:
script: |
const splitComment = github.event.comment.body.split(' ');
splitComment.length !== 2 && (github.rest.issues.createComment({
issue_number: process.env.ISSUE_NUMBER,
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Invalid comment format. Expected: "!preview <one-word-snapshot-name>"',
}) || exit 1);
}) || core.setFailed('Invalid comment format. Expected: "!preview <one-word-snapshot-name>"'));
return splitComment[1].trim();
result-encoding: string
@ -82,13 +80,12 @@ jobs:
- name: Pull Request Notification
uses: actions/github-script@v6
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
MESSAGE: ${{ steps.changesets.outputs.publish }}
with:
script: |
console.log(process.env.ISSUE_NUMBER, process.env.MESSAGE);
console.log(process.env.MESSAGE);
github.rest.issues.createComment({
issue_number: process.env.ISSUE_NUMBER,
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '```\n' + process.env.MESSAGE + '\n```',