Skip to content

Update minetest module, rename to luanti #53

Update minetest module, rename to luanti

Update minetest module, rename to luanti #53

Workflow file for this run

name: Check Added Submodules
on:
pull_request_target:
jobs:
style:
name: Run StyLua
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout LLS-Addons
with:
submodules: false
- name: Set Base and Head Refs
run: |
echo "BASE_REF=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
echo "HEAD_REF=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
echo "BASE_REMOTE=${{github.event.pull_request.base.repo.clone_url}}" >> $GITHUB_ENV
echo "HEAD_REMOTE=${{github.event.pull_request.head.repo.clone_url}}" >> $GITHUB_ENV
- name: Fetch Branches
run: |
git remote add base $BASE_REMOTE
git fetch base $BASE_REF
git remote add head $HEAD_REMOTE
git fetch head $HEAD_REF
- name: Detect Added Submodules
run: |
ADDED_SUBMODULES=$(git diff --submodule --compact-summary remotes/base/${BASE_REF}..remotes/head/${HEAD_REF} | grep -vE ".*\(gone\)" | grep -oE "addons/.*/module")
echo "Added submodules: $ADDED_SUBMODULES"
echo "ADDED_SUBMODULES<<EOF" >> $GITHUB_ENV
echo $ADDED_SUBMODULES
echo 'EOF' >> $GITHUB_ENV
- name: Fetch submodules
run: |
for submodule in $ADDED_SUBMODULES; do
echo "Getting submodule: $submodule"
git submodule update --init --recursive $submodule
done
- uses: JohnnyMorganz/[email protected]
name: Run StyLua
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check addons
metadata:
name: Fetch metadata
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
name: Checkout LLS-Addons
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
submodules: false
- name: Set Base and Head Refs
run: |
echo "BASE_REF=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
echo "HEAD_REF=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
echo "BASE_REMOTE=${{github.event.pull_request.base.repo.clone_url}}" >> $GITHUB_ENV
echo "HEAD_REMOTE=${{github.event.pull_request.head.repo.clone_url}}" >> $GITHUB_ENV
- name: Fetch Branches
run: |
git remote add base $BASE_REMOTE
git fetch base $BASE_REF
git remote add head $HEAD_REMOTE
git fetch head $HEAD_REF
- name: Detect Added Submodules
run: |
ADDED_SUBMODULES=$(git diff --submodule --compact-summary remotes/base/${BASE_REF}..remotes/head/${HEAD_REF} | grep -vE ".*\(gone\)" | grep -oE "addons/.*/module")
echo "Added submodules: $ADDED_SUBMODULES"
echo "ADDED_SUBMODULES<<EOF" >> $GITHUB_ENV
echo $ADDED_SUBMODULES
echo 'EOF' >> $GITHUB_ENV
- name: Fetch submodules
run: |
for submodule in $ADDED_SUBMODULES; do
echo "Getting submodule: $submodule"
git submodule update --init --recursive $submodule
done
# Custom action that gets metadata on each addon
- uses: dsaltares/[email protected]
name: Get submodule metadata fetching action
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: LuaLS/LLS-Addons-Action
file: dist.zip
target: action.zip
- name: Unzip custom action
run: unzip action.zip -d action
- uses: ./action/dist
name: Get Addon Metadata
# Commit new metadata
- name: Commit Metadata
uses: stefanzweifel/[email protected]
with:
commit_message: "chore: Update Addon Metadata"
file_pattern: addons/*/info.json
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com