@@ -93,38 +93,38 @@ jobs:
93
93
if : steps.get_latest_official_release.outputs.found == 'true'
94
94
run : |
95
95
mkdir -p dist/appcast
96
- - name: Download appcast.xml
97
- if: steps.get_latest_official_release.outputs.found == 'true'
98
- uses: actions/github-script@v7
99
- with:
100
- script: |
101
- const fs = require('fs');
102
- const path = require('path');
103
- const { data: releaseAssets } = await github.rest.repos.listReleaseAssets({
96
+ - name : Download appcast.xml
97
+ if : steps.get_latest_official_release.outputs.found == 'true'
98
+ uses : actions/github-script@v7
99
+ with :
100
+ script : |
101
+ const fs = require('fs');
102
+ const path = require('path');
103
+ const { data: releaseAssets } = await github.rest.repos.listReleaseAssets({
104
+ owner: context.repo.owner,
105
+ repo: context.repo.repo,
106
+ release_id: (await github.rest.repos.getReleaseByTag({
104
107
owner: context.repo.owner,
105
108
repo: context.repo.repo,
106
- release_id: (await github.rest.repos.getReleaseByTag({
107
- owner: context.repo.owner,
108
- repo: context.repo.repo,
109
- tag: core.getInput('tag_name')
110
- })).data.id
111
- });
112
- const appcastAsset = releaseAssets.find(asset => asset.name === 'appcast.xml');
113
- if (!appcastAsset) {
114
- throw new Error('appcast.xml not found in the release assets.');
109
+ tag: core.getInput('tag_name')
110
+ })).data.id
111
+ });
112
+ const appcastAsset = releaseAssets.find(asset => asset.name === 'appcast.xml');
113
+ if (!appcastAsset) {
114
+ throw new Error('appcast.xml not found in the release assets.');
115
+ }
116
+ const { data: fileContent } = await github.rest.repos.getReleaseAsset({
117
+ owner: context.repo.owner,
118
+ repo: context.repo.repo,
119
+ asset_id: appcastAsset.id,
120
+ headers: {
121
+ Accept: 'application/octet-stream'
115
122
}
116
- const { data: fileContent } = await github.rest.repos.getReleaseAsset({
117
- owner: context.repo.owner,
118
- repo: context.repo.repo,
119
- asset_id: appcastAsset.id,
120
- headers: {
121
- Accept: 'application/octet-stream'
122
- }
123
- });
124
- const outputDir = path.join(process.env.GITHUB_WORKSPACE, 'dist', 'appcast');
125
- fs.mkdirSync(outputDir, { recursive: true });
126
- fs.writeFileSync(path.join(outputDir, 'appcast.xml'), fileContent);
127
- console.log('appcast.xml downloaded successfully.');
123
+ });
124
+ const outputDir = path.join(process.env.GITHUB_WORKSPACE, 'dist', 'appcast');
125
+ fs.mkdirSync(outputDir, { recursive: true });
126
+ fs.writeFileSync(path.join(outputDir, 'appcast.xml'), fileContent);
127
+ console.log('appcast.xml downloaded successfully.');
128
128
- name : Deploy to GitHub Pages
129
129
uses : peaceiris/actions-gh-pages@v3
130
130
with :
0 commit comments