https://github.com/Ash258/Scoop-GithubActions
Deprecated. Use https://github.com/shovel-org/GithubActions
https://github.com/Ash258/Scoop-GithubActions
github-action github-actions scoop shovel
Last synced: 4 months ago
JSON representation
Deprecated. Use https://github.com/shovel-org/GithubActions
- Host: GitHub
- URL: https://github.com/Ash258/Scoop-GithubActions
- Owner: Ash258
- License: mit
- Archived: true
- Created: 2019-06-20T15:02:52.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2021-08-09T18:09:01.000Z (over 3 years ago)
- Last Synced: 2024-03-15T01:20:35.496Z (about 1 year ago)
- Topics: github-action, github-actions, scoop, shovel
- Language: PowerShell
- Homepage:
- Size: 264 KB
- Stars: 25
- Watchers: 3
- Forks: 18
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- jimsghstars - Ash258/Scoop-GithubActions - Deprecated. Use https://github.com/shovel-org/GithubActions (PowerShell)
README
# Discontinued
Scoop version is discontinued and this repository will not be updated anymore and archived in near future.
Refer to [Shovel](https://github.com/Ash258/Scoop-Core) version of this repository:# 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](https://github.com/Ash258/Scoop-GithubActions/tree/stable-win)/[main-win](https://github.com/Ash258/Scoop-GithubActions/tree/main-win) branches.
Linux based actions are no longer supported and maintained.## Available actions
`GITH_EMAIL` environment is not required since [1.0.1](https://github.com/Ash258/Scoop-GithubActions/releases/tag/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](https://github.com/phips28/gh-action-bump-version/commit/adda5b22b3c785eb69d328f91dadb49a4c34a82e))### Excavator (`Excavator`)
- ❗❗❗ [Protected master branches are not supported](https://github.community/t5/GitHub-Actions/How-to-push-to-protected-branches-in-a-GitHub-Action/m-p/30710/highlight/true#M526) ❗❗❗
- Periodically execute automatic updates for all manifests
- Refer to [help page](https://help.github.com/en/articles/events-that-trigger-workflows#scheduled-events) for configuration formats
- alternative
- No need to have custom device, which could run docker or scheduled task for auto-pr 24/7### 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
1. Result is parsed
1. Hash mismatch
1. Pull requests with name `@: Hash fix` are listed
1. There is PR already
1. The newest one is selected
1. Description of this PR is updated with closing directive for created issue
1. Comment to issue is posted with reference to PR
1. If none
1. New branch `-hash-fix-` is created
1. Changes are commited
1. New PR is created from this branch
1. Labels `hash-fix-needed`, `verified` are added
1. No problem
1. Comment on issue is posted about hashes being right and possible causes
1. Label `hash-fix-needed` is removed
1. Issue is closed
1. Binary error
1. Label `package-fix-needed` is added
- **Download failed**
1. All urls defined in manifest are retrieved
1. Downloading of all urls is executed
1. Comment to issue is posted
1. If there is problematic URL
1. List of these URLs is attached in comment
1. Labels `package-fix-needed`, `verified`, `help-wanted` is added
1. 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:
- ❗❗ [Pull request created from forked repository cannot be finished due to different permission scope of token](https://github.com/Ash258/Scoop-GithubActions/issues/42) ❗❗
- Manual `/verify` comment is needed1. Required properties are in place
- Manifest has to contain `License` and `Description` properties
1. Hashes of URLs match
- Hashes specified in manifest have to match
1. Checkver functionality
- Checkver has to finished successfully
- Version in manifest has to match version from checkver binary (latest possible)
1. 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`- All checks could be executed with `/verify` comment. ()
## 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```yml
#.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: [email protected]
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: [email protected] # 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: [email protected] # 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: [email protected] # Not needed, but recommended
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```## How to debug locally
```powershell
# 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', '', 'Process')
[System.Environment]::SetEnvironmentVariable('GITHUB_EVENT_NAME', '', '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`.