Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Commit

Permalink
Clarify Excavator problem
Browse files Browse the repository at this point in the history
* Try with SSH

* Set remote

* Install openssh

* ssh-keyscan github.com

* Log known hosts

* Log known hosts

* Revert adding of cosi.psm1

* Correct permissions

* test

* Test with pub

* ?

* gci

* debug

* debug

* Test

* https

* Idiot...

* ditch SSH and wait for response from Github

* remove debug

* debug tags

* Revert "debug tags"

This reverts commit 5ecf016.

* Clarify protected branches

* Reflect change of scheduled event naming

* Try to keep it old way

* Revert "Try to keep it old way"

This reverts commit 6a72755.

Workaround with set url is needed https://github.com/Ash258/GithubActionsBucketForTesting/runs/213456507#step:4:110
  • Loading branch information
Ash258 authored Sep 5, 2019
1 parent 0fe0408 commit 459f4c0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
LocalTestEnvironment.ps1
Cosi*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV SCOOP /SCOOP
ENV SCOOP_HOME ${SCOOP}/apps/scoop/current
ENV SCOOP_DEBUG 1

RUN apk add --no-cache --virtual .scoop-deps git p7zip aria2 \
RUN apk add --no-cache --virtual .scoop-deps openssh git p7zip aria2 \
&& apk add hub --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
&& git clone 'https://github.com/lukesampson/scoop.git' ${SCOOP_HOME}

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Set of automated actions you will ever need as bucket maintainer. Using `stable`

### Excavator (`Excavator | Excavate`)

- ❗❗❗ 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 <https://developer.github.com/actions/managing-workflows/creating-and-cancelling-a-workflow/#scheduling-a-workflow> for configuration formats
- Refer to [help page](https://help.github.com/en/articles/events-that-trigger-workflows#scheduled-events) for configuration formats
- <https://github.com/ScoopInstaller/Excavator> alternative.
- If you do not have custom server / device which could run docker or scheduled task for auto-pr 24/7.

Expand Down Expand Up @@ -68,7 +70,7 @@ As soon as PR is created (or someone post comment `/verify`) set of these tests
```yml
#.github\workflows\schedule.yml
on:
schedules:
schedule:
- cron: '*/30 * * * *'
name: Excavator
jobs:
Expand Down
9 changes: 5 additions & 4 deletions src/Helpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Get-EnvironmentVariables {
List all environment variables. Mainly debug purpose.
Do not leak GITHUB_TOKEN.
#>
return Get-ChildItem env: | Where-Object { $_.Name -ne 'GITHUB_TOKEN' }
return Get-ChildItem env: | Where-Object { ($_.Name -ne 'GITHUB_TOKEN') -and ($_.Name -ne 'SSH_KEY') }
}

function New-Array {
Expand Down Expand Up @@ -98,11 +98,12 @@ function Initialize-NeededSettings {
} else {
Write-Log 'Pushing is not possible without email environment'
}

$user = ($env:GITHUB_REPOSITORY -split '/')[0]
# TODO: Test push to protected branch
git remote 'set-url' origin "https://${user}:$env:GITHUB_TOKEN@github.com/$env:GITHUB_REPOSITORY.git"
# Not sure how this will be influenced by organization
git config --global user.name $user
# TODO: Organization will work?
$rem = "https://${user}:$env:GITHUB_TOKEN@github.com/$env:GITHUB_REPOSITORY.git"
git remote 'set-url' --push origin $rem

if (-not $env:HUB_VERBOSE) {
$env:HUB_VERBOSE = '1'
Expand Down

0 comments on commit 459f4c0

Please sign in to comment.