fix(ci): run workflows in target repository context

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-10-21 18:57:29 +02:00 committed by David Mehren
parent 410e5b2222
commit dfba39266a
11 changed files with 109 additions and 108 deletions

View file

@ -1,23 +0,0 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
#
json=$($(dirname "$0")/netlify-cli.sh deploy --build --prod --json --message "${1:0:8}: $2")
if [ $? -ne 0 ]; then
echo "Error while executing netlify! Will try again without json..."
$(dirname "$0")/netlify-cli.sh deploy --build --prod --message "${1:0:8}: $2"
exit 1
fi
echo "${json}"
url=$(echo "${json}" | jq -r .deploy_url)
logs=$(echo "${json}" | jq -r .logs)
echo "::set-output name=url::${url}"
echo "::set-output name=logs::${logs}"

View file

@ -1,23 +0,0 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
#
json=$($(dirname "$0")/netlify-cli.sh deploy --build --context deploy-preview --alias "$1" --json --message "[#$1] $2")
if [ $? -ne 0 ]; then
echo "Error while executing netlify! Will try again without json..."
$(dirname "$0")/netlify-cli.sh deploy --build --context deploy-preview --alias "$1" --message "[#$1] $2"
exit 1
fi
echo "${json}"
url=$(echo "${json}" | jq -r .deploy_url)
logs=$(echo "${json}" | jq -r .logs)
echo "::set-output name=url::${url}"
echo "::set-output name=logs::${logs}"

View file

@ -1,10 +0,0 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
#
NETLIFY_VERSION=12.0.11
exec npx --yes netlify-cli@${NETLIFY_VERSION} $@

View file

@ -1,18 +0,0 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
#
set -e
echo 'Patch intro.md to include netlify banner.'
cp netlify/intro.md public/public/intro.md
echo 'Patch motd.md to include privacy policy.'
cp netlify/motd.md public/public/motd.md
echo 'Patch version.json to include git hash'
jq ".version = \"0.0.0+${GITHUB_SHA:0:8}\"" src/version.json > src/_version.json
mv src/_version.json src/version.json
echo "Patch base URL"
echo HD_EDITOR_BASE_URL="${1}" >> .env.production