name: 'Enable Lightbearer pack'

on:
  schedule:
    # Run annually at 04:00 UTC on January 1st.
    - cron: '0 4 1 1 *'
  workflow_dispatch:

jobs:
  enable-lightbearer:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}
          token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

      - name: Read .nvmrc
        run: echo ::set-output name=NVMRC::$(cat .nvmrc)
        id: nvm

      - name: Set up Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '${{ steps.nvm.outputs.NVMRC }}'

      - name: Install dependencies
        run: npm install

      - name: Enable pack
        run: |
          node scripts/enable-marker-pack.mjs lightbearer
          git config user.name 'Mathias Bynens'
          git config user.email 'mathias@qiwi.be'
          git commit data -m 'Enable Lightbearer pack' -m 'This patch enables the Lightbearer markers in preparation for the upcoming event (which runs from November 11th until November 15th).'
          git push

name: 'Enable Lightbearer pack'

on:
  schedule:
    # Run annually at 04:00 UTC on November 1st.
    - cron: '0 4 1 11 *'
  workflow_dispatch:

jobs:
  enable-lightbearer:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}
          token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

      - name: Read .nvmrc
        run: echo ::set-output name=NVMRC::$(cat .nvmrc)
        id: nvm

      - name: Set up Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '${{ steps.nvm.outputs.NVMRC }}'

      - name: Install dependencies
        run: npm install

      - name: Enable pack
        run: |
          node scripts/enable-marker-pack.mjs lightbearer
          git config user.name 'Mathias Bynens'
          git config user.email 'mathias@qiwi.be'
          git commit data -m 'Enable Lightbearer pack' -m 'This patch enables the Lightbearer markers in preparation for the upcoming event (which runs from November 11th until November 15th).'
          git push

Change Lightbearer pack enable date to November
Change Lightbearer pack enable date to November
