Skip to content

frostming/scoop-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github actions for scoop buckets

Set of automated actions, which will bucket maintainer ever need to save time managing issues/pull requets. Using stable tag instead of specific version is highly recommended.

Use SHOVEL environment variable for more advanced and optimized scoop implementation.

Available environment variables

  1. GITHUB_TOKEN
    • REQUIRED
    • Use ${{ secrets.GITHUB_TOKEN }}
  2. GITH_EMAIL**
    • String
    • If specified, SHOVEL implementation will be used
  3. SHOVEL
    • Anything. Use 1
    • If specified, SHOVEL implementation will be used
    • It will be required in future versions to support installation/uninstallation PR checks
  4. SCOOP_BRANCH
    • String
    • If specified, scoop config 'SCOOP_BRANCH' will be configured and scoop updated
  5. SKIP_UPDATED
    • Anything. Use 1
    • If specified, log of checkver utility will not print latest versions
  6. SPECIAL_SNOWFLAKES
    • String
    • List of manifest names joined with , used as parameter for auto-pr utility.

**: GITH_EMAIL environment variable is not required since 1.0.1, but it is recommended. If email is not specified, commits will not be pushed using account bounded to the email. This will lead to not adding contributions. (See as example commit from github action without user's email)

Available actions

Excavator

Issues

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

  • Hash check fails
    1. Checkhashes binary is executed for manifest in title
    2. Result is parsed
      1. Hash mismatch
        1. Pull requests with name <manifest>@<version>: Fix hash are listed
          1. There is PR already
            1. The newest one is selected
            2. Description of this PR is updated with closing directive for created issue
            3. Comment to issue is posted with reference to PR
            4. Label duplicate added
          2. If none
            1. New branch <manifest>-hash-fix-<random> is created
            2. Changes are commited
            3. New PR is created from this branch
        2. Labels hash-fix-needed, verified are added
      2. No problem
        1. Comment on issue is posted about hashes being right and possible causes
        2. Label hash-fix-needed is removed
        3. Issue is closed
      3. Binary error
        1. Label manifest-fix-needed is added
  • Download failed
    1. All urls defined in manifest are retrieved
    2. Downloading of all urls is executed
    3. Comment to issue is posted
      1. If there is problematic URL
        1. List of these URLs is attached in comment
        2. Labels manifest-fix-needed, verified, help wanted are added
      2. All URLs could be downloaded without problem
        1. Possible causes are attached in comment

Pull Requests

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

Overview of validatiors

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

Example workflows for all actions

  • Names could be changed as desired
  • if statements are not required
    • There are only time savers when finding appropriate action log
    • Save GitHub resources
#.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: Ash258/Scoop-GithubActions@stable-win
      env:
        GITH_EMAIL: youremail@mail.com
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        SKIP_UPDATED: '1'

#.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: Ash258/Scoop-GithubActions@stable-win
      if: github.event.action == 'opened' || (github.event.action == 'labeled' && contains(github.event.issue.labels.*.name, 'verify'))
      env:
        GITH_EMAIL: youremail@mail.com # Not needed, but recommended
        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: Ash258/Scoop-GithubActions@stable-win
      if: startsWith(github.event.comment.body, '/verify')
      env:
        GITH_EMAIL: youremail@mail.com # Not needed, but recommended
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

#.github\workflows\pull_request.yml
on:
  pull_request:
    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: Ash258/Scoop-GithubActions@stable-win
      env:
        GITH_EMAIL: youremail@mail.com # Not needed, but recommended
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}