Home

Awesome

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:

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

#.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.