0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00

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