Skip to content

Commit bb7f746

Browse files
authored
Merge pull request #166 from phunkyfish/fix-multiline-workflows-omega
Fix github workflows
2 parents aebbe83 + bf012a0 commit bb7f746

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

.github/workflows/changelog-and-release.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,19 @@ jobs:
4444
fetch-depth: 0
4545
path: ${{ github.event.repository.name }}
4646

47-
# Checkout the required scripts from kodi-pvr/pvr-scripts into the 'scripts' directory
47+
# Checkout the required scripts from xbmc/binary-addon-scripts into the 'scripts' directory
4848
- name: Checkout Scripts
4949
uses: actions/checkout@v4
5050
with:
5151
fetch-depth: 0
52-
repository: kodi-pvr/pvr-scripts
52+
repository: xbmc/binary-addon-scripts
5353
path: scripts
5454

5555
# Install all dependencies required by the following steps
5656
# - libxml2-utils, xmlstarlet: reading news and version from addon.xml.in
5757
- name: Install dependencies
5858
run: |
59+
sudo apt-get update
5960
sudo apt-get install libxml2-utils xmlstarlet
6061
6162
# Setup python version 3.9
@@ -84,6 +85,7 @@ jobs:
8485
# - steps.required-variables.outputs.version: version element from addon.xml.in
8586
# - steps.required-variables.outputs.branch: branch of the triggering ref
8687
# - steps.required-variables.outputs.today: today's date in format '%Y-%m-%d'
88+
# Note: we use a random EOF for 'changes' as is best practice for for multiline variables
8789
- name: Get required variables
8890
id: required-variables
8991
run: |
@@ -92,12 +94,10 @@ jobs:
9294
then
9395
changes=$(xmlstarlet fo -R "$(find . -name addon.xml.in)" | xmlstarlet sel -t -v 'string(/addon/extension/news)' | awk -v RS= 'NR==1')
9496
fi
95-
changes="${changes//'%'/'%25'}"
96-
changes="${changes//$'\n'/'%0A'}"
97-
changes="${changes//$'\r'/'%0D'}"
98-
changes="${changes//$'\\n'/'%0A'}"
99-
changes="${changes//$'\\r'/'%0D'}"
100-
echo "changes=$changes" >> $GITHUB_OUTPUT
97+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
98+
echo "changes<<$EOF" >> $GITHUB_OUTPUT
99+
echo "$changes" >> $GITHUB_OUTPUT
100+
echo "$EOF" >> $GITHUB_OUTPUT
101101
version=$(xmlstarlet fo -R "$(find . -name addon.xml.in)" | xmlstarlet sel -t -v 'string(/addon/@version)')
102102
echo "version=$version" >> $GITHUB_OUTPUT
103103
branch=$(echo ${GITHUB_REF#refs/heads/})

.github/workflows/increment-version.yml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242

4343
- name: Install dependencies
4444
run: |
45+
sudo apt-get update
4546
sudo apt-get install libxml2-utils xmlstarlet
4647
4748
- name: Get required variables

.github/workflows/release.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ jobs:
2323
# - libxml2-utils, xmlstarlet: reading news and version from addon.xml.in
2424
- name: Install dependencies
2525
run: |
26+
sudo apt-get update
2627
sudo apt-get install libxml2-utils xmlstarlet
2728
2829
# Create the variables required by the following steps
2930
# - steps.required-variables.outputs.changes: latest entry in the changelog.txt (if exists), or addon.xml.in news element
3031
# - steps.required-variables.outputs.version: version element from addon.xml.in
3132
# - steps.required-variables.outputs.branch: branch of the triggering ref
33+
# Note: we use a random EOF for 'changes' as is best practice for for multiline variables
3234
- name: Get required variables
3335
id: required-variables
3436
run: |
@@ -37,12 +39,10 @@ jobs:
3739
then
3840
changes=$(xmlstarlet fo -R "$(find . -name addon.xml.in)" | xmlstarlet sel -t -v 'string(/addon/extension/news)' | awk -v RS= 'NR==1')
3941
fi
40-
changes="${changes//'%'/'%25'}"
41-
changes="${changes//$'\n'/'%0A'}"
42-
changes="${changes//$'\r'/'%0D'}"
43-
changes="${changes//$'\\n'/'%0A'}"
44-
changes="${changes//$'\\r'/'%0D'}"
45-
echo "changes=$changes" >> $GITHUB_OUTPUT
42+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
43+
echo "changes<<$EOF" >> $GITHUB_OUTPUT
44+
echo "$changes" >> $GITHUB_OUTPUT
45+
echo "$EOF" >> $GITHUB_OUTPUT
4646
version=$(xmlstarlet fo -R "$(find . -name addon.xml.in)" | xmlstarlet sel -t -v 'string(/addon/@version)')
4747
echo "version=$version" >> $GITHUB_OUTPUT
4848
branch=$(echo ${GITHUB_REF#refs/heads/})

0 commit comments

Comments
 (0)