|
61 | 61 | env: |
62 | 62 | VERSION: ${{ steps.next.outputs.version }} |
63 | 63 | with: |
64 | | - result-encoding: string |
65 | 64 | # Commit & tag with the actions token, so that they get signed |
| 65 | + # This returns the commit sha and the tag object sha |
66 | 66 | script: | |
67 | 67 | const fs = require("fs/promises"); |
68 | 68 | const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); |
@@ -122,27 +122,29 @@ jobs: |
122 | 122 | }); |
123 | 123 | console.log("Created tag:", tag.data.url); |
124 | 124 |
|
125 | | - return commit.data.sha; |
| 125 | + return { commit: commit.data.sha, tag: tag.data.sha }; |
126 | 126 |
|
127 | 127 | - name: Update the refs |
128 | 128 | |
129 | 129 | env: |
130 | 130 | VERSION: ${{ steps.next.outputs.version }} |
131 | | - COMMIT: ${{ steps.commit.outputs.result }} |
| 131 | + TAG_SHA: ${{ fromJSON(steps.commit.outputs.result).tag }} |
| 132 | + COMMIT_SHA: ${{ fromJSON(steps.commit.outputs.result).commit }} |
132 | 133 | with: |
133 | 134 | # Update the refs with the bot token, so that workflows are triggered |
134 | 135 | github-token: ${{ secrets.BOT_GITHUB_TOKEN }} |
135 | 136 | script: | |
136 | 137 | const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); |
137 | 138 | const version = process.env.VERSION; |
138 | | - const commit = process.env.COMMIT; |
| 139 | + const commit = process.env.COMMIT_SHA; |
| 140 | + const tag = process.env.TAG_SHA; |
139 | 141 | const branch = process.env.GITHUB_REF_NAME; |
140 | 142 |
|
141 | 143 | const tag = await github.rest.git.createRef({ |
142 | 144 | owner, |
143 | 145 | repo, |
144 | 146 | ref: `refs/tags/v${version}`, |
145 | | - sha: commit, |
| 147 | + sha: tag, |
146 | 148 | }); |
147 | 149 | console.log("Created tag ref:", tag.data.url); |
148 | 150 |
|
|
0 commit comments