Update the nCine addons submodule #31
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Added Submodules | |
on: | |
pull_request: | |
branches: | |
- main | |
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: | | |
BASE_REF="${{ github.event.pull_request.base.sha }}" | |
HEAD_REF="${{ github.event.pull_request.head.sha }}" | |
BASE_REMOTE="${{github.event.pull_request.base.repo.clone_url}}" | |
HEAD_REMOTE="${{github.event.pull_request.head.repo.clone_url}}" | |
echo "BASE_REF=$BASE_REF" >> $GITHUB_ENV | |
echo "HEAD_REF=$HEAD_REF" >> $GITHUB_ENV | |
echo "BASE_REMOTE=$BASE_REMOTE" >> $GITHUB_ENV | |
echo "HEAD_REMOTE=$HEAD_REMOTE" >> $GITHUB_ENV | |
- name: Fetch Branches | |
run: | | |
git fetch ${BASE_REMOTE} ${BASE_REF} | |
git fetch ${HEAD_REMOTE} ${HEAD_REF} | |
- name: Detect Added Submodules | |
run: | | |
BASE_REF=${{ github.event.pull_request.base.sha }} | |
HEAD_REF=${{ github.event.pull_request.head.sha }} | |
ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..${HEAD_REF} | grep '^Submodule' | awk '{ print $2 }') | |
echo "Added submodules: $ADDED_SUBMODULES" | |
echo "ADDED_SUBMODULES=$ADDED_SUBMODULES" >> $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/stylua-action@v2.0.0 | |
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: | |
submodules: false | |
- name: Set Base and Head Refs | |
run: | | |
BASE_REF="${{ github.event.pull_request.base.ref }}" | |
HEAD_REF="${{ github.event.pull_request.head.ref }}" | |
BASE_REMOTE="${{github.event.pull_request.base.repo.clone_url}}" | |
HEAD_REMOTE="${{github.event.pull_request.head.repo.clone_url}}" | |
echo "BASE_REF=$BASE_REF" >> $GITHUB_ENV | |
echo "HEAD_REF=$HEAD_REF" >> $GITHUB_ENV | |
echo "BASE_REMOTE=$BASE_REMOTE" >> $GITHUB_ENV | |
echo "HEAD_REMOTE=$HEAD_REMOTE" >> $GITHUB_ENV | |
- name: Fetch Branches | |
run: | | |
git fetch ${BASE_REMOTE} ${BASE_REF} | |
git fetch ${HEAD_REMOTE} ${HEAD_REF} | |
- name: Detect Added Submodules | |
run: | | |
ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..${{github.sha}} | grep '^Submodule' | awk '{ print $2 }') | |
echo "Added submodules: $ADDED_SUBMODULES" | |
echo "ADDED_SUBMODULES=$ADDED_SUBMODULES" >> $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/fetch-gh-release-asset@1.1.0 | |
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/git-auto-commit-action@v4.16.0 | |
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 |