Skip to content

Commit 76de730

Browse files
fix(update-flathub-repo): ensure .github files are not empty (#710)
1 parent 97efea5 commit 76de730

1 file changed

Lines changed: 29 additions & 18 deletions

File tree

.github/workflows/__call-update-flathub-repo.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,6 @@ jobs:
8585
run: |
8686
rm -rf ./*
8787
88-
- name: Copy github files
89-
if: >-
90-
steps.check-label.outputs.hasTopic == 'true' &&
91-
steps.check-release.outputs.isLatestRelease == 'true'
92-
working-directory: flathub/${{ env.FLATHUB_PKG }}
93-
run: |
94-
mkdir -p .github/ISSUE_TEMPLATE
95-
96-
# sponsors
97-
curl -sS https://github.com/LizardByte/.github/raw/refs/heads/master/.github/FUNDING.yml \
98-
-o .github/FUNDING.yml
99-
# pull request template
100-
curl -sS https://github.com/LizardByte/.github/raw/refs/heads/master/.github/pull_request_template.md \
101-
-o .github/pull_request_template.md
102-
# issue config
103-
curl -sS https://github.com/LizardByte/.github/raw/refs/heads/master/.github/ISSUE_TEMPLATE/config.yml \
104-
-o .github/ISSUE_TEMPLATE/config.yml
105-
10688
- name: Download release asset
10789
id: download
10890
if: >-
@@ -125,6 +107,35 @@ jobs:
125107
run: |
126108
rm -f flathub/${{ env.FLATHUB_PKG }}/flathub.tar.gz
127109
110+
- name: Copy github files
111+
if: >-
112+
steps.check-label.outputs.hasTopic == 'true' &&
113+
steps.check-release.outputs.isLatestRelease == 'true'
114+
working-directory: flathub/${{ env.FLATHUB_PKG }}
115+
run: |
116+
download_github_file() {
117+
local source="$1"
118+
local destination="$2"
119+
120+
curl --fail --location --silent --show-error --retry 3 "$source" --output "$destination"
121+
test -s "$destination"
122+
}
123+
124+
mkdir -p .github/ISSUE_TEMPLATE
125+
126+
# sponsors
127+
download_github_file \
128+
"https://raw.githubusercontent.com/LizardByte/.github/master/.github/FUNDING.yml" \
129+
".github/FUNDING.yml"
130+
# pull request template
131+
download_github_file \
132+
"https://raw.githubusercontent.com/LizardByte/.github/master/.github/pull_request_template.md" \
133+
".github/pull_request_template.md"
134+
# issue config
135+
download_github_file \
136+
"https://raw.githubusercontent.com/LizardByte/.github/master/.github/ISSUE_TEMPLATE/config.yml" \
137+
".github/ISSUE_TEMPLATE/config.yml"
138+
128139
- name: Update metainfo.xml
129140
id: update_metainfo
130141
if: >-

0 commit comments

Comments
 (0)