refactor: Remove unused usages and improve undocumented function desc… #12
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: Auto-update libraries in X4-LuaLSAddon | |
| on: | |
| push: | |
| paths: | |
| - 'data/*.hjson' | |
| jobs: | |
| update-library: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout AddonPrep repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: common/X4-LuaLSAddonPrep | |
| - name: Checkout X4-LuaLSAddon repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ github.repository_owner }}/X4-LuaLSAddon | |
| path: common/X4-LuaLSAddon | |
| token: ${{ secrets.LIBRARY_TOKEN }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Generate branch name | |
| id: branch-name | |
| run: echo "branch_name=library-update-$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT | |
| # - name: Create branch in X4-LuaLSAddon | |
| # working-directory: common/X4-LuaLSAddon | |
| # run: | | |
| # git config user.name "${{ github.actor }}" | |
| # git config user.email "${{ github.actor }}@users.noreply.github.com" | |
| # git checkout -b ${{ steps.branch-name.outputs.branch_name }} | |
| - name: Install dependencies | |
| working-directory: common/X4-LuaLSAddonPrep/script | |
| run: npm install | |
| - name: Generate annotations | |
| working-directory: common/X4-LuaLSAddonPrep/script | |
| run: node generateAllAnnotations.js --generate-from-data | |
| - name: Check for changes | |
| id: check_changes | |
| working-directory: common/X4-LuaLSAddon | |
| run: | | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor }}@users.noreply.github.com" | |
| git add . | |
| git diff --staged --quiet || echo "changes=true" >> $GITHUB_OUTPUT | |
| # - name: Commit and push changes | |
| # if: steps.check_changes.outputs.changes == 'true' | |
| # working-directory: common/X4-LuaLSAddon | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.LIBRARY_TOKEN }} | |
| # run: | | |
| # git commit -m "Auto-update X4 add-on library from data files" | |
| - name: Create Pull Request | |
| if: steps.check_changes.outputs.changes == 'true' | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.LIBRARY_TOKEN }} | |
| path: common/X4-LuaLSAddon | |
| commit-message: Auto-update X4 add-on library from data files | |
| title: Auto-update X4 add-on library from data files | |
| body: | | |
| This PR was automatically generated by GitHub Actions. | |
| It contains updates to the X4 add-on library generated from the latest data files. | |
| branch: ${{ steps.branch-name.outputs.branch_name }} | |
| base: main |