opened
fredefox
username_0
I suspect this is related to my usage of submodules. Initially I suspected it was because I was using `git@` for the submodules, so I wrote a step just before the upload action that rewrites the URLs in `.gitmodules` using `sed`. This didn't seem to fix the issue. I can't figure out what the refs are pointing to. They are neither in the submodules, nor my main repository.

**Reproduce**
Run the workflow from https://github.com/username_0/cat/pull/16 There you can also find the workflow that I'm using: https://github.com/username_0/cat/blob/username_0/gh-pages/.github/workflows/main.yml

**Logs**
```
2020-05-16T11:34:46.0657910Z ##[group]Run username_1/github-pages-deploy-action@releases/v3
2020-05-16T11:34:46.0658364Z with:
2020-05-16T11:34:46.0658684Z   ACCESS_TOKEN: ***
2020-05-16T11:34:46.0658763Z   BRANCH: gh-pages
2020-05-16T11:34:46.0659014Z   FOLDER: html
2020-05-16T11:34:46.0659280Z ##[endgroup]
2020-05-16T11:34:46.1899409Z Checking configuration and starting deployment… 🚦
2020-05-16T11:34:46.1912285Z Deploying using Access Token… 🔑
2020-05-16T11:34:46.1914504Z Configuring git…
2020-05-16T11:34:46.1991775Z [command]/usr/bin/git init
2020-05-16T11:34:46.2084724Z Reinitialized existing Git repository in /home/runner/work/cat/cat/.git/
2020-05-16T11:34:46.2141438Z [command]/usr/bin/git config user.name username_0
2020-05-16T11:34:46.2200441Z [command]/usr/bin/git config user.email username_0@users.noreply.github.com
2020-05-16T11:34:46.2258537Z [command]/usr/bin/git remote rm origin
2020-05-16T11:34:46.2328556Z [command]/usr/bin/git remote add origin https://***@github.com/username_0/cat.git
2020-05-16T11:34:46.2387925Z [command]/usr/bin/git fetch
2020-05-16T11:34:46.7365950Z From https://github.com/username_0/cat
2020-05-16T11:34:46.7368544Z  * [new branch]      abstract-funext   -> origin/abstract-funext
2020-05-16T11:34:46.7368818Z  * [new branch]      username_0/gh-pages -> origin/username_0/gh-pages
2020-05-16T11:34:46.7369072Z  * [new branch]      username_0/travis   -> origin/username_0/travis
2020-05-16T11:34:46.7370460Z  * [new branch]      gh-pages          -> origin/gh-pages
2020-05-16T11:34:46.7370878Z  * [new branch]      master            -> origin/master
2020-05-16T11:34:46.7371101Z  * [new branch]      try-wrapped-paths -> origin/try-wrapped-paths
2020-05-16T11:34:46.7540964Z  * [new tag]         0.0.1             -> 0.0.1
2020-05-16T11:34:46.7541648Z  * [new tag]         1.0.0             -> 1.0.0
2020-05-16T11:34:46.7542171Z  * [new tag]         1.0.1             -> 1.0.1
2020-05-16T11:34:46.7542657Z  * [new tag]         1.1.0             -> 1.1.0
2020-05-16T11:34:46.7543138Z  * [new tag]         1.2.0             -> 1.2.0
2020-05-16T11:34:46.7543626Z  * [new tag]         1.3.0             -> 1.3.0
2020-05-16T11:34:46.7544107Z  * [new tag]         1.4.0             -> 1.4.0
2020-05-16T11:34:46.7544564Z  * [new tag]         1.4.1             -> 1.4.1
2020-05-16T11:34:46.7545050Z  * [new tag]         1.5.0             -> 1.5.0
2020-05-16T11:34:46.7546510Z  * [new tag]         1.6.0             -> 1.6.0
2020-05-16T11:34:46.8730768Z Fetching submodule libs/agda-stdlib
2020-05-16T11:34:47.0713083Z Fetching submodule libs/cubical
2020-05-16T11:34:47.4210696Z fatal: remote error: upload-pack: not our ref 0d3f02e68297e940227137beac45fc1bce6e2bea
2020-05-16T11:34:47.7142770Z fatal: remote error: upload-pack: not our ref 4493cf249a1648be2ad365fe94ece337bfbcb5d9
2020-05-16T11:34:47.7215624Z Errors during submodule fetch:
2020-05-16T11:34:47.7215893Z 	libs/cubical
2020-05-16T11:34:47.7216327Z 	libs/agda-stdlib
2020-05-16T11:34:47.7257861Z ##[error]There was an error initializing the repository: The process '/usr/bin/git' failed with exit code 1 ❌
2020-05-16T11:34:47.7267482Z failed
2020-05-16T11:34:47.7269681Z Deployment Failed ❌
2020-05-16T11:34:47.7272095Z ::set-env name=DEPLOYMENT_STATUS::failed
```
Publish fails with git error "not our ref"
issue
created
fredefox
username_0
Additional steps I took that are not version-controlled:
* Create a token for the gh-pages action
* Add the token to the "secrets" of the repo
* Created an orphaned branch `gh-pages` in the same repo
* Added a test-commit to that branch which successfully deploys and is viewable at https://username_0.github.io/cat/
comment
created
JamesIves
username_1
That error is pretty generic, it basically just means that git was unable to run a command for whatever reason. It looks like it's ultimately failing when `git fetch` is run [here](https://github.com/username_1/github-pages-deploy-action/blob/dev/src/git.ts#L27) (although `git fetch` is run several times during the process as the action switches between a few branches before making the deployment).

I'll admit I'm not hugely familiar with submodules but I assume what's happening here is that it's trying to run `git fetch` on them and it's throwing the error because it doesn't actually know about the submodules.  I'm wondering if adding a flag to the `git fetch` commands such as this [one](https://git-scm.com/docs/fetch-options#Documentation/fetch-options.txt---no-recurse-submodules) may prevent this issue. Looking at the checkout action it adds some [additional flags](https://github.com/actions/checkout/blob/master/src/git-command-manager.ts#L167-L196).

I'd love to solve this. If you have any suggestions on a preferred approach it would be appreciated.
comment
created
fredefox
username_0
Thanks for looking into this! What makes it a bit difficult for me to debug is that the commands aren't run on my machine. In my specific use-case I don't think the `github-pages-deploy-action` action really needs to do anything with the submodules. I suppose that's the same conclusion you've arrived at, so perhaps that's solution is generally applicable. I didn't think that `git fetch` would load submodules by default. Perhaps they changed that? In any case I definitely think that _for my particular use-case_ `--no-recurse-submodules` is satisfactory. But I confess, I'm not sure why `github-pages-deploy-action` needs to do a fetch in the first place...

If I were to debug this, would I simply clone your repository and change the value for `uses: username_1/github-pages-deploy-action@releases/v3` to be `uses: username_0/github-pages-deploy-action@releases/v3`?
comment
created
JamesIves
username_1
I'm all for removing the use of `git fetch` so long as the current functionality remains. I've tried removing it in the past but I ended up encountering some issues. 

Yep, you'd clone the repository and follow the deploy steps in this guide: https://github.com/username_1/github-pages-deploy-action/blob/dev/CONTRIBUTING.md#deploying. The part after the `@` is a branch name, so if your version is on the `master` branch you'd point it to `uses: username_0/github-pages-deploy-action@master`. Let me know if that works for you, appreciate the assistance in debugging.
comment
created
fredefox
username_0
I've made my change and commited `node_modules`, yet it seems to having some issues resolving the dependencies. Perhaps I'm doing something wrong? The error that I'm seeing:
```
##[error]Could not find file '/home/runner/work/_actions/_temp_7c50805b-74c8-4906-8020-8993a8e0bb09/_staging/username_0-github-pages-deploy-action-639e288/node_modules/istanbul-lib-instrument/node_modules/@babel/core/node_modules/.bin/json5'.
```
From https://github.com/username_0/cat/pull/16/checks?check_run_id=682675060

On this branch: https://github.com/username_0/github-pages-deploy-action/tree/dev
comment
created
JamesIves
username_1
You should point it to `uses: username_0/github-pages-deploy-action@dev` - however you probably just need to hit the `Rerun Workflow` button at the top right a few times, this is a weird bug I've encountered when a new change is made.
comment
created
fredefox
username_0
Thanks for your help with this James! I finally got it working and managed to upload my things here https://username_0.github.io/cat/
comment
closed
JamesIves
username_1
issue
created
JamesIves
username_1
Released with `3.5.3`, thanks for the PR!
comment
created
fredefox
username_0
I should remember to thank you for your encouraging spirit! I feel that it often happens that people see it as a burden when someone submits issues or even PRs against their code.
comment