Skip to content

Commit 2712484

Browse files
authored
Update upload asset step for phar workflow (#2380)
1 parent 4f08182 commit 2712484

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/phar.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ jobs:
4040
run: ~/.composer/vendor/bin/box compile
4141

4242
- name: Upload Release Asset
43-
id: upload-release-asset
44-
uses: actions/upload-release-asset@v1
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
uses: actions/github-script@v8
4744
with:
48-
upload_url: ${{ github.event.release.upload_url }}
49-
asset_path: ./phinx.phar
50-
asset_name: phinx.phar
51-
asset_content_type: application/octet-stream
45+
github-token: "${{ secrets.GITHUB_TOKEN }}"
46+
script: |
47+
const fs = require('fs').promises;
48+
await github.rest.repos.uploadReleaseAsset({
49+
name: 'phinx.phar',
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
release_id: context.payload.release.id,
53+
data: await fs.readFile('./phinx.phar')
54+
});

0 commit comments

Comments
 (0)