GithubHelp home page GithubHelp logo

sauloxd / review-apps Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 5.0 13 MB

Manage MULTIPLE static applications in your github-pages

License: MIT License

JavaScript 38.84% HTML 4.13% CSS 6.84% TypeScript 50.01% Shell 0.18%
github-actions storybook

review-apps's People

Contributors

sauloxd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

review-apps's Issues

Deprecated set-env

Seeing this error message, looks like you need to bump the @actions/core package maybe?

/usr/bin/git config --global user.name review-app-action-user
/usr/bin/git config --global user.email review-app-action-email
/usr/bin/git config pull.rebase true
Error: Unable to process command '::set-env name=PUBLIC_URL::<hidden>' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Optional build-cmd

When running in GitHub Actions, the build-cmd is unnecessary, because I can just add a build step before the uses step. The build-cmd input also can't do things like cd demo && pnpm run build && touch .nojekyll, so I had to build it before the step and change the build-cmd to echo "Already built". It would be easier if I could just not specify build-cmd and it didn't run it.

Skip creating index.html

We want to create review apps, but don't want to remove the existing index.html --- Can we have an option to skip index.html creation?

Job failing with ambiguous argument 'origin/refs/heads/master': unknown revision or path not in the working tree.

Here's the link to the failed run with debug logging enabled: https://github.com/ItsSunnyMonster/merge/actions/runs/10119347055/job/27987710478

Here's the logs from the job with debug logging enabled (should also be available in the link above)

##[debug]Evaluating condition for step: 'Build and deploy docs'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Build and deploy docs
##[debug]Loading inputs
##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run sauloxd/review-apps@v[2](https://github.com/ItsSunnyMonster/merge/actions/runs/10119347055/job/27987710478#step:4:2).0.0
##[debug]CALL run
##[debug]WITH []
-> Review Apps start!
-> Your input: 
-> Validating user input
-> {
  "dist": "dist",
  "slug": "review-apps",
  "ghPagesBranch": "gh-pages",
  "buildCmd": "",
  "githubToken": "***",
  "skipIndexHtml": false,
  "tmpDir": ".tmp-review-apps",
  "apps": [
    {
      "slug": "docs",
      "build": "cargo doc --no-deps",
      "dist": "target/doc/merge"
    }
  ]
}
/usr/bin/git --version
git version 2.45.2
/usr/bin/git config --global user.name ReviewApps admin
/usr/bin/git config --global user.email [email protected]
/usr/bin/git config pull.rebase true
/usr/bin/echo .tmp-review-apps >> .git/info/exclude
.tmp-review-apps >> .git/info/exclude
##[debug]CALL syncApps
##[debug]WITH [
##[debug]  {
##[debug]    "repository": {
##[debug]      "name": "merge",
##[debug]      "owner": "ItsSunnyMonster"
##[debug]    },
##[debug]    "branch": {
##[debug]      "name": "refs/heads/master",
##[debug]      "headCommit": "f6a[3](https://github.com/ItsSunnyMonster/merge/actions/runs/10119347055/job/27987710478#step:4:3)f7cc9dad1853bfce46de3785f1d0ee679da9",
##[debug]      "pullRequest": {}
##[debug]    }
##[debug]  }
##[debug]]

    -> Your apps will be hosted in github pages:
    -> "https://ItsSunnyMonster.github.io/merge"
  
/usr/bin/git fetch origin refs/heads/master
From https://github.com/ItsSunnyMonster/merge
 * branch            master     -> FETCH_HEAD
/usr/bin/git checkout -f refs/heads/master
Note: switching to 'refs/heads/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at f6a3f7c ci: fix rust toolchain
/usr/bin/git reset --hard origin/refs/heads/master
fatal: ambiguous argument 'origin/refs/heads/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error: FAILED syncApps
##[debug]The process '/usr/bin/git' failed with exit code 128
Error: FAILED run
##[debug]The process '/usr/bin/git' failed with exit code 128

/home/runner/work/_actions/sauloxd/review-apps/v2.0.0/packages/action/webpack:/node_modules/@actions/exec/lib/toolrunner.js:592
                error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
^
Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/runner/work/_actions/sauloxd/review-apps/v2.0.0/packages/action/webpack:/node_modules/@actions/exec/lib/toolrunner.js:592:1)
    at ExecState.CheckComplete (/home/runner/work/_actions/sauloxd/review-apps/v2.0.0/packages/action/webpack:/node_modules/@actions/exec/lib/toolrunner.js:575:1)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/sauloxd/review-apps/v2.0.0/packages/action/webpack:/node_modules/@actions/exec/lib/toolrunner.js:[4](https://github.com/ItsSunnyMonster/merge/actions/runs/10119347055/job/27987710478#step:4:4)69:1)
    at ChildProcess.emit (node:events:[5](https://github.com/ItsSunnyMonster/merge/actions/runs/10119347055/job/27987710478#step:4:5)19:28)
    at maybeClose (node:internal/child_process:1105:1[6](https://github.com/ItsSunnyMonster/merge/actions/runs/10119347055/job/27987710478#step:4:6))
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Build and deploy docs

Action Breaks with Nested Branch Names

Hi, there!

We are using this action to deploy our review apps for Pull Requests and it is working quite nicely for the most part. The action runs and creates the new Github page successfully.

The problem comes right after the folder is successfully created in our gh-pages branch. It's trying to fetch the origin of the original PR branch and fails.

At first glance, it looks like it is only grabbing the branch name after the /.

For example... we have a branch called feat/migrate-to-github-actions. Creating a PR against our main branch, everything works perfectly fine. All of our tests run, the review app kicks off, and then creates our new folder in our gh-pages directory.

Then the action throws an error, because it's trying to fetch origin on migrate-to-github-actions and not feat/migrate-to-github-actions where our actual branch is. A real example error encounter and output can be seen below:

/usr/bin/git push origin gh-pages
To https://github.com/orgNameRedacted/repoNameRedacted
   86a2253..a75c6a5  gh-pages -> gh-pages
/usr/bin/git fetch origin migrate-to-github-actions
fatal: couldn't find remote ref migrate-to-github-actions
Error: The process '/usr/bin/git' failed with exit code 128
(node:14081) UnhandledPromiseRejectionWarning: Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/vsts-agent/actions-runner/_work/_actions/sauloxd/review-apps/v1.3.3/packages/action/dist/index.js:1026:25)
    at ExecState.CheckComplete (/home/vsts-agent/actions-runner/_work/_actions/sauloxd/review-apps/v1.3.3/packages/action/dist/index.js:1009:18)
    at ChildProcess.<anonymous> (/home/vsts-agent/actions-runner/_work/_actions/sauloxd/review-apps/v1.3.3/packages/action/dist/index.js:903:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)
(node:14081) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14081) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

(I redacted org and repo name above since the is for a private setup)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.