ScoopInstaller / GithubActions

Github Actions for Scoop buckets
MIT License
24 stars 22 forks source link

[BUG]: Can not find the correct branch #10

Closed yi-Xu-0100 closed 2 years ago

yi-Xu-0100 commented 2 years ago

Prerequisites

Package Name

All

Expected/Current Behaviour

I created a bucket which generated from https://github.com/ScoopInstaller/BucketTemplate, and I follow the introduction by README.md to enable GitHub Actions for this repository and modify the README.md and the bin/auto-pr.ps1 files accordingly.

But the excavator action went with wrong in scheduled mode and manual mode. It worked pass but not update the manifest.json See in

Steps to Reproduce

Generate a bucket with https://github.com/ScoopInstaller/BucketTemplate, and set the main branch as `main`.

Possible Solution

For the error logs is the follow:

INFO: Scheduled initialized
Updating ...
hub pull origin master
$ git config alias.pull
$ git pull origin master
fatal: couldn't find remote ref master
^^^ Error! See above ^^^ (last command: hub pull origin master)
INFO: Scheduled finished

I think the action get the branch wrong with my repo - yi-Xu-0100/scoop-bucket (branch is main, not master).

And also I think it may cause by the follow: https://github.com/ScoopInstaller/GithubActions/blob/3409da73ff0c201c44725d1935ca28bacef306fd/src/Action/Scheduled.psm1#L10-L22

In my actions, It did not have $env:GITHUB_BRANCH, and the branch will be set with master.

I think it may set with the bin/auto-pr.ps1, which will edit by bucket owner.

Scoop and Buckets Version

Not relevant.

Scoop Config

Not relevant.

PowerShell Version

Not relevant.

Additional Softwares

No response