18
18
- uses : actions/setup-node@v4
19
19
- name : ' validation'
20
20
uses : actions/github-script@v7
21
+ env :
22
+ VERSION : ${{ github.event.inputs.version }}
21
23
with :
22
24
script : |
25
+ const version = process.env.VERSION;
23
26
const permission = await github.rest.repos.getCollaboratorPermissionLevel({
24
27
owner: context.repo.owner,
25
28
repo: context.repo.repo,
29
32
core.setFailed(`User ${context.actor} does not have write or admin permissions to this repository.`);
30
33
}
31
34
const currentBranch = context.ref.replace('refs/heads/', '');
32
- if (currentBranch !== `release/${{ github.event.inputs. version } }`) {
33
- core.setFailed(`Current branch ${currentBranch} does not match release/${{ github.event.inputs. version } }`);
35
+ if (currentBranch !== `release/${version}`) {
36
+ core.setFailed(`Current branch ${currentBranch} does not match release/${version}`);
34
37
}
35
38
const pullRequests = await github.rest.pulls.list({
36
39
owner: context.repo.owner,
@@ -53,11 +56,13 @@ jobs:
53
56
- name : ' publish to npm'
54
57
env :
55
58
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
+ VERSION : ${{ github.event.inputs.version }}
56
60
run : |
57
- yarn lerna version ${{ github.event.inputs.version }} --yes
61
+ yarn lerna version "$VERSION" --yes
58
62
yarn lerna publish from-git --yes
59
63
- name : ' approve a pull request'
60
64
env :
61
65
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66
+ PR_NUMBER : ${{ env.PR_NUMBER }}
62
67
run : |
63
- gh pr review ${{ env. PR_NUMBER }} --approve --body "approved by automation"
68
+ gh pr review "$ PR_NUMBER" --approve --body "approved by automation"
0 commit comments