Contributing

Contributions to TwitchAdSolutions are welcome! This project thrives on community updates, whether it's adding a new solution or updating the existing scripts.

Pull Request Process

  1. Fork the Repository: Start by forking the main repository on GitHub.
  2. Create a Branch: For any new changes, create a new branch from master. A good branch name is descriptive, e.g., update-vaft-script or add-new-extension.
  3. Make Your Changes: Edit the relevant files. The core logic for the custom scripts resides in the vaft/ and video-swap-new/ directories.
  4. Submit a Pull Request: Push your branch to your fork and open a pull request to the master branch of the original repository. Provide a clear description of the changes you have made.

Automated Releases

This project uses GitHub Actions to automate the creation of new releases for the custom scripts. This ensures that changes are versioned and published consistently.

The workflow is defined in the .github/workflows/release.yml file. A new release is automatically drafted and published whenever a commit is pushed to the master branch that includes changes in the following directories:

  • vaft/
  • video-swap-new/

The release tag is generated using the GitHub run number (e.g., v123), and the release notes are populated from the commit message of the triggering commit.

Release Workflow Configuration

Below is the content of the release.yml workflow for reference:

name: Create Release

on:
  push:
    branches:
      - master
    paths:
      - "vaft/**"
      - "video-swap-new/**"

jobs:
  create-release:
    permissions:
      contents: write
    name: Create Release
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - name: Set up Git user
      run: |
        git config user.name "github-actions[bot]"
        git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

    - name: Set release notes
      id: set-notes
      run: |
        changes=$(git log -1 --pretty=format:%s)
        echo "release_notes=$changes" >> $GITHUB_ENV

    - name: Create Release
      id: create-release
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: "v${{ github.run_number }}"
        release_name: "Release v${{ github.run_number }}"
        body: ${{ env.release_notes }}
        draft: false
        prerelease: false