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.
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)
- ❗❗❗ Protected master branches are not supported ❗❗❗
- Periodically execute automatic updates for all manifests
- Refer to help page for configuration formats
- https://github.com/ScoopInstaller/Excavator alternative
- No need to have custom device, which could run docker or scheduled task for auto-pr 24/7
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
- Checkhashes binary is executed
- Result is parsed
- Hash mismatch
- Pull requests with name
<manifest>@<version>: Hash fix
are 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
- 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
,verified
are added
- Pull requests with name
- No problem
- Comment on issue is posted about hashes being right and possible causes
- Label
hash-fix-needed
is removed - Issue is closed
- Binary error
- Label
package-fix-needed
is 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
package-fix-needed
,verified
,help-wanted
is added
- All URLs could be downloaded without problem
- Possible causes are attached in comment
- If there is problematic URL
As soon as PR is created or someone post comment /verify
set of these tests are executed:
- ❗❗ Pull request created from forked repository cannot be finished due to different permission scope of token ❗❗
- Manual
/verify
comment is needed
- Manual
- Required properties are in place
- Manifest has to contain
License
andDescription
properties
- Manifest has to contain
- Hashes of URLs match
- Hashes specified in manifest have to match
- Checkver functionality
- Checkver has to finished successfully
- Version in manifest has to match version from checkver binary (latest possible)
- Autoupdate
- Autoupdate has to finish successfully
- Hashes extraction has to finish successfully
- If there is
hash
property insideautoupdate
output of checkver binary cannot containsCould not find hash
- If there is
- All checks could be executed with
/verify
comment. (Ash258/GithubActionsBucketForTesting#176)
- 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: ScoopInstaller/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: ScoopInstaller/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: ScoopInstaller/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: ScoopInstaller/Scoop-GithubActions@stable
env:
GITH_EMAIL: youremail@mail.com # Not needed, but recommended
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 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
.
The alternative of this repository for Shovel is https://github.com/shovel-org/GithubActions