ScoopInstaller / GithubActions

Github Actions for Scoop buckets
MIT License
24 stars 22 forks source link

Github Actions for Scoop buckets

Set of automated actions, which bucket maintainers can use to save time managing issues / pull requests.

Available environment variables

  1. GITHUB_TOKEN
    • REQUIRED
    • Use ${{ secrets.GITHUB_TOKEN }}
  2. USER_EMAIL
    • String
    • Optional
  3. SCOOP_REPO
    • String
    • If specified, scoop config 'scoop_repo' will be configured and scoop updated
  4. SCOOP_BRANCH
    • String
    • If specified, scoop config 'scoop_branch' will be configured and scoop updated
  5. SKIP_UPDATED
    • String. Use '1' or '0'
    • If enabled, log of checkver utility will not print latest versions
  6. THROW_ERROR
    • String. Use '1' or '0'
    • If enabled, error from checkver utility will be thrown as exception and cause the run to fail
  7. SPECIAL_SNOWFLAKES
    • String
    • List of manifest names joined with , used as parameter for auto-pr utility.

Available actions

Excavator

Issues

As soon as a new issue is created or the label verify is added to an issue, the action is executed. Based on the issue title, a specific sub-action is executed. It could be one of these:

Pull Requests

As soon as a PR is created or the comment /verify is posted to it, validation tests are executed (see wiki) for detailed desciption):

Overview of validatiors

  1. JSON standard format check
  2. Required properties (License, Description) are in place
  3. Hashes of files are correct
  4. Checkver functionality
  5. Autoupdate functionality
    1. Hash extraction finished

Example workflows for all actions

#.github\workflows\schedule.yml
on:
  schedule:
  - cron: '*/30 * * * *'
name: Excavator
jobs:
  excavate:
    name: Excavator
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@main
    - name: Excavator
      uses: ScoopInstaller/GithubActions@main
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        SKIP_UPDATED: '1'
        THROW_ERROR: '0'

#.github\workflows\issues.yml
on:
  issues:
    types: [ opened, labeled ]
name: Issue
jobs:
  issueHandler:
    name: Issue Handler
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@main
    - name: Issue Handler
      uses: ScoopInstaller/Scoop-GithubActions@main
      if: github.event.action == 'opened' || (github.event.action == 'labeled' && contains(github.event.issue.labels.*.name, 'verify'))
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

#.github\workflows\issue_commented.yml
on:
  issue_comment:
    types: [ created ]
name: Commented Pull Request
jobs:
  pullRequestHandler:
    name: Pull Request Validator
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@main
    - name: Pull Request Validator
      uses: ScoopInstaller/GithubActions@main
      if: startsWith(github.event.comment.body, '/verify')
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

#.github\workflows\pull_request.yml
on:
  pull_request_target:
    types: [ opened ]
name: Pull Requests
jobs:
  pullRequestHandler:
    name: Pull Request Validator
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@main
    - name: Pull Request Validator
      uses: ScoopInstaller/GithubActions@main
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}