|
12 | 12 | required: false
|
13 | 13 | type: string
|
14 | 14 | default: cygport
|
| 15 | + tag_name: |
| 16 | + description: Name of the tag for the release |
| 17 | + required: true |
| 18 | + type: string |
15 | 19 | secrets:
|
16 | 20 | maintainer_key:
|
17 | 21 | description: RSA private key for uploading to Cygwin servers in OpenSSH format
|
@@ -104,17 +108,24 @@ jobs:
|
104 | 108 | - name: Get the release target branch
|
105 | 109 | id: target
|
106 | 110 | uses: actions/github-script@v6
|
| 111 | + env: |
| 112 | + TAG_NAME: ${{ inputs.tag_name }} |
107 | 113 | with:
|
108 | 114 | script: |
|
109 |
| - const target_commitish = context.payload.release.target_commitish; |
110 |
| - if (target_commitish.startsWith('refs/heads/')) { |
111 |
| - target_ref = target_commitish.substring(11); |
| 115 | + const releaseRsp = await github.rest.repos.getReleaseByTag({ |
| 116 | + owner: context.repo.owner, |
| 117 | + repo: context.repo.repo, |
| 118 | + tag: process.env.TAG_NAME |
| 119 | + }); |
| 120 | + const targetCommitish = releaseRsp.data.target_commitish; |
| 121 | + if (targetCommitish.startsWith('refs/heads/')) { |
| 122 | + targetRef = targetCommitish.substring(11); |
112 | 123 | } else if (target_commitish.startsWith('refs/tags/')) {
|
113 |
| - target_ref = target.commitish.substring(10); |
| 124 | + targetRef = targetCommitish.substring(10); |
114 | 125 | } else {
|
115 |
| - core.setFailed('Unexpected target_commitish: ' + target_commitish); |
| 126 | + core.setFailed('Unexpected target_commitish: ' + targetCommitish); |
116 | 127 | }
|
117 |
| - core.setOutput('target_ref', target_ref); |
| 128 | + core.setOutput('target_ref', targetRef); |
118 | 129 |
|
119 | 130 | - name: Get build cache
|
120 | 131 | id: build-cache
|
@@ -183,7 +194,7 @@ jobs:
|
183 | 194 |
|
184 | 195 | - name: Mirror to the Cygwin Git repositories
|
185 | 196 | env:
|
186 |
| - TAG_NAME: ${{ github.event.release.tag_name }} |
| 197 | + TAG_NAME: ${{ inputs.tag_name }} |
187 | 198 | run: git push "[email protected]:/git/cygwin-packages/$Env:CYGPORT_NAME" tag "$Env:TAG_NAME"
|
188 | 199 |
|
189 | 200 | - name: Remove maintainer key
|
|
0 commit comments