Skip to content

Check variables in 250 apps #10

Check variables in 250 apps

Check variables in 250 apps #10

name: Check environment variables from installation scripts
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build
if: always()
run: |
wget -q https://github.com/ivan-hc/AM/archive/refs/heads/dev.zip
unzip -qq ./dev.zip
cd AM-dev/programs/x86_64 || exit 1
for f in *; do
if grep -q "api.github.com" "$f" 2> /dev/null; then
if grep -q "browser_download_url" "$f" 2> /dev/null; then
if ! grep -q "appimagetool" "$f" 2> /dev/null; then
if grep -q "mage" "$f" 2> /dev/null; then
sed -i "s#curl -Ls #curl -Ls --header 'authorization: ivan-hc $\{\{ secrets.GITHUB_TOKEN \}\}' #g" "$f"
if grep -q "^APP=" "$f" 2> /dev/null; then
APP=$(eval echo "$(grep -i '^APP=' "$f" | head -1 | sed 's/APP=//g')")
echo "APP=\"$APP\""
fi
if grep -q "^REPO=" "$f" 2> /dev/null; then
REPO=$(eval echo "$(grep -i '^REPO=' "$f" | head -1 | sed 's/REPO=//g')")
echo "REPO=\"$REPO\""
fi
if grep -q "^SITE=" "$f" 2> /dev/null; then
SITE=$(eval echo "$(grep -i '^SITE=' "$f" | head -1 | sed 's/SITE=//g')")
echo "SITE=\"$SITE\""
fi
if grep -q "^d=" "$f" 2> /dev/null; then
d=$(eval echo "$(grep -i '^d=' "$f" | head -1 | sed 's/d=//g')")
echo "d=\"$d\""
fi
if grep -q "^dl=" "$f" 2> /dev/null; then
dl=$(eval echo "$(grep -i '^dl=' "$f" | head -1 | sed 's/dl=//g')")
echo "dl=\"$dl\""
fi
if grep -q "^rel=" "$f" 2> /dev/null; then
rel=$(eval echo "$(grep -i '^rel=' "$f" | head -1 | sed 's/rel=//g')")
echo "rel=\"$rel\""
fi
if grep -q "^tag=" "$f" 2> /dev/null; then
tag=$(eval echo "$(grep -i '^tag=' "$f" | head -1 | sed 's/tag=//g')")
echo "tag=\"$tag\""
fi
if grep -q "^v=" "$f" 2> /dev/null; then
v=$(eval echo "$(grep -i '^v=' "$f" | head -1 | sed 's/v=//g')")
echo "v=\"$v\""
fi
if grep -q "^ver=" "$f" 2> /dev/null; then
ver=$(eval echo "$(grep -i '^ver=' "$f" | head -1 | sed 's/ver=//g')")
echo "ver=\"$ver\""
fi
if grep -q "^version=" "$f" 2> /dev/null; then
version=$(eval echo "$(grep -i '^version=' "$f" | head -1 | sed 's/version=//g')")
echo "version=\"$version\""
fi
unset APP 2> /dev/null
unset REPO 2> /dev/null
unset SITE 2> /dev/null
unset version 2> /dev/null
echo '-----------------------------------------------------------------'
fi
fi
fi
fi
done