From 9f558740ba6c62b7c24903b94e2fbd8e093c6ca6 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sun, 14 Apr 2024 16:51:20 -0700 Subject: [PATCH] Use git to install MediaWiki Rather than downloading and extracting the release file, use git (via the `actions/checkout@v2` GitHub action) to install MediaWiki. By default this will not include the history of the repo (no change from prior download method) but will include files that MediaWiki specifies should not be exported (change from prior download method that motivates this). SEL-558 --- action.yml | 9 ++++++++- install.sh | 12 ++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/action.yml b/action.yml index 96d8fd3..9093274 100644 --- a/action.yml +++ b/action.yml @@ -34,8 +34,15 @@ runs: path: ~/.composer/cache key: composer-php${{ inputs.php }} + - name: Download Mediawiki + uses: actions/checkout@v2 + with: + path: mediawiki + repository: wikimedia/mediawiki + ref: ${{ inputs.mwbranch }} + - name: Install MediaWiki - run: bash $GITHUB_ACTION_PATH/install.sh ${{ inputs.mwbranch }} ${{ inputs.extension }} ${{ inputs.type }} + run: bash $GITHUB_ACTION_PATH/install.sh ${{ inputs.extension }} ${{ inputs.type }} shell: bash - uses: actions/checkout@v2 diff --git a/install.sh b/install.sh index e102429..1c04653 100755 --- a/install.sh +++ b/install.sh @@ -2,16 +2,8 @@ set -o pipefail -MW_BRANCH=$1 -EXTENSION_NAME=$2 -TYPE=$3 - -# Download wiki release -wget https://github.com/wikimedia/mediawiki/archive/$MW_BRANCH.tar.gz -nv -q - -# Extract into `mediawiki` directory -tar -zxf $MW_BRANCH.tar.gz -mv mediawiki-$MW_BRANCH mediawiki +EXTENSION_NAME=$1 +TYPE=$2 # Install composer dependencies cd mediawiki && composer install