Skip to content
package

GitHub Action

Bucket Minion

1.5.0.2 Latest version

Discontinued

Scoop version is discontinued and this repository will not be updated anymore and archived in near future. Refer to Shovel version of this repository: https://github.com/shovel-org/GithubActions

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.

For better/native implementation using Windows image refer to stable-win/main-win branches. Linux based actions are no longer supported and maintained.

Available actions

GITH_EMAIL environment is not required since 1.0.1, but it is recommended. If email is not specified commits will not be pushed using your account, which will not add contributions. (See)

Excavator (Excavator)

Issues (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
    2. Result is parsed
      1. Hash mismatch
        1. Pull requests with name <manifest>@<version>: Hash fix 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
          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 package-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 package-fix-needed, verified, help-wanted is added
      2. All URLs could be downloaded without problem
        1. Possible causes are attached in comment

Pull requests (Pull requests | PullRequestHandler)

As soon as PR is created or someone post comment /verify set of these tests are executed:

  1. Required properties are in place
    • Manifest has to contain License and Description properties
  2. Hashes of URLs match
    • Hashes specified in manifest have to match
  3. Checkver functionality
    • Checkver has to finished successfully
    • Version in manifest has to match version from checkver binary (latest possible)
  4. Autoupdate
    • Autoupdate has to finish successfully
    • Hashes extraction has to finish successfully
      • If there is hash property inside autoupdate output of checkver binary cannot contains Could not find hash

Example workflows for all actions

  • Names could be changed as needed
  • if statements are not required
    • There are only time savers for going through lots of action logs
    • Save GitHub resources
#.github\workflows\schedule.yml
on:
  schedule:
  - cron: '*/30 * * * *'
name: Excavator
jobs:
  excavate:
    name: Excavate
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Excavate
      uses: Ash258/Scoop-GithubActions@stable
      env:
        GITH_EMAIL: youremail@mail.com
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        SKIP_UPDATED: '1'

#.github\workflows\issues.yml
on:
  issues:
    types: [ opened, labeled ]
name: Issues
jobs:
  issueHandler:
    name: IssueHandler
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: IssueHandler
      uses: Ash258/Scoop-GithubActions@stable
      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: Pull requests comment
jobs:
  pullRequestHandler:
    name: PullRequestHandler
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: PullRequestHandler
      uses: Ash258/Scoop-GithubActions@stable
      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: PullRequestHandler
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: PullRequestHandler
      uses: Ash258/Scoop-GithubActions@stable
      env:
        GITH_EMAIL: youremail@mail.com # Not needed, but recommended
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How to debug locally

# LocalTestEnvironment.ps1

# Try to avoid all real requests into real repository
#    All events inside repository will use GithubActionsBucketForTesting repository for testing purpose
[System.Environment]::SetEnvironmentVariable('GITHUB_TOKEN', '<yourtoken>', 'Process')
[System.Environment]::SetEnvironmentVariable('GITHUB_EVENT_NAME', '<EVENT YOU WANT TO DEBUG>', 'Process')
# Create Cosi.json with any request from events folder
[System.Environment]::SetEnvironmentVariable('GITHUB_EVENT_PATH', "$PSScriptRoot\cosi.json", 'Process')
[System.Environment]::SetEnvironmentVariable('GITHUB_REPOSITORY', 'Ash258/GithubActionsBucketForTesting', 'Process')
$DebugPreference = 'Continue'
git clone 'https://github.com/Ash258/GithubActionsBucketForTesting.git' '/github/workspace'
# Uncomment debug entries in Dockerfile

Execute docker run -ti (((docker build -q .) -split ':')[1]) or docker build . -t 'actions:master'; docker run -ti actions.