Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/refresh-modpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Refresh Modpack File Index
on:
push:
branches:
- main
pull_request_target:
types:
- opened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
refresh-modpack:
name: Refresh Modpack ${{ matrix.modpack }}
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
strategy:
matrix:
modpack:
- forgeworks
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Install Dependencies
uses: ./.github/actions/install-yarn-dependencies
with:
node-version: 22
- name: Install nix
uses: cachix/install-nix-action@526118121621777ccd86f79b04685a9319637641 # v31
- name: Configure Git
run: |
git remote set-url origin "https://${GITHUB_TOKEN}:x-oauth-basic@github.com/${GITHUB_REPOSITORY}.git"
git config --local user.email "${GITHUB_EMAIL}"
git config --local user.name "${GITHUB_USER}"
env:
GITHUB_USER: github-actions[bot]
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: yarn build
- name: Refresh Modpack
working-directory: packages/${{ matrix.modpack }}/modpack
run: nix develop --command packwiz refresh
- name: Commit Changes and Push
run: |
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "chore(${{ matrix.modpack }}): refresh index"
git pull --rebase origin ${{ github.head_ref || 'main' }}
git push origin HEAD:${{ github.head_ref || 'main' }}
else
echo "No changes to commit."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading