mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
Update snapshot-release.yml
This commit is contained in:
parent
c58d962dfa
commit
8031ef8039
1 changed files with 17 additions and 17 deletions
34
.github/workflows/snapshot-release.yml
vendored
34
.github/workflows/snapshot-release.yml
vendored
|
@ -26,6 +26,23 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- 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,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: 'Invalid comment format. Expected: "!preview <one-word-snapshot-name>"',
|
||||||
|
}) || exit 1);
|
||||||
|
return splitComment[1].trim();
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.inputs.ref }}
|
ref: ${{ github.event.inputs.ref }}
|
||||||
|
@ -45,23 +62,6 @@ jobs:
|
||||||
- name: Build Packages
|
- name: Build Packages
|
||||||
run: pnpm run build
|
run: pnpm run build
|
||||||
|
|
||||||
- name: Extract the snapshot name from comment body
|
|
||||||
id: getSnapshotName
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
env:
|
|
||||||
MESSAGE: ${{ steps.changesets.outputs.publish }}
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const splitComment = github.event.comment.body.split(' ');
|
|
||||||
splitComment.length !== 2 && (github.rest.issues.createComment({
|
|
||||||
issue_number: process.env.ISSUE_NUMBER,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
body: 'Invalid comment format. Expected: "!preview <one-word-snapshot-name>"',
|
|
||||||
}) || exit 1);
|
|
||||||
return splitComment[1].trim();
|
|
||||||
result-encoding: string
|
|
||||||
|
|
||||||
- name: Get result
|
- name: Get result
|
||||||
run: echo "${{steps.set-result.outputs.result}}"
|
run: echo "${{steps.set-result.outputs.result}}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue