GithubActions
GithubActions copied to clipboard
Github Actions for Scoop buckets
Github Actions for Scoop buckets
Set of automated actions, which bucket maintainers can use to save time managing issues / pull requests.
Available environment variables
GITHUB_TOKEN- REQUIRED
- Use
${{ secrets.GITHUB_TOKEN }}
USER_EMAIL- String
- Optional
SCOOP_REPO- String
- If specified, scoop config 'scoop_repo' will be configured and scoop updated
SCOOP_BRANCH- String
- If specified, scoop config 'scoop_branch' will be configured and scoop updated
SKIP_UPDATED- String. Use
'1'or'0' - If enabled, log of checkver utility will not print latest versions
- String. Use
THROW_ERROR- String. Use
'1'or'0' - If enabled, error from checkver utility will be thrown as exception and cause the run to fail
- String. Use
SPECIAL_SNOWFLAKES- String
- List of manifest names joined with
,used as parameter for auto-pr utility.
Available actions
Excavator
- Protected default branches are not supported.
- Periodically execute automatic updates for all manifests
- Refer to workflow triggers for configuration formats
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:
- Hash check fails
- Checkhashes binary is executed for manifest in title
- Result is parsed
- Hash mismatch
- Pull requests with name
<manifest>@<version>: Fix hashare listed- There is PR already
- The newest one is selected
- Description of this PR is updated with closing directive for created issue
- Comment to issue is posted with reference to PR
- Label
duplicateadded
- If none
- New branch
<manifest>-hash-fix-<random>is created - Changes are commited
- New PR is created from this branch
- New branch
- There is PR already
- Labels
hash-fix-needed,verifiedare added
- Pull requests with name
- No problem
- Comment on issue is posted about hashes being right and possible causes
- Label
hash-fix-neededis removed - Issue is closed
- Binary error
- Label
manifest-fix-neededis added
- Label
- Hash mismatch
- Download failed
- All urls defined in manifest are retrieved
- Downloading of all urls is executed
- Comment to issue is posted
- If there is problematic URL
- List of these URLs is attached in comment
- Labels
manifest-fix-needed,verified,help wantedare added
- All URLs could be downloaded without problem
- Possible causes are attached in comment
- If there is problematic URL
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
- JSON standard format check
- Required properties (
License,Description) are in place - Hashes of files are correct
- Checkver functionality
- Autoupdate functionality
- Hash extraction finished
Example workflows for all actions
- Names could be changed as desired
ifstatements 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: 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 }}