Hi, Iโm Eric. Iโm a developer and a writer living near Washington DC.
I work at GitHub, helping the Public Sector make better, more secure software.
Let's grab coffee.
GitHub Actions for running Javascript build tools and committing file changes
Hi, Iโm Eric. Iโm a developer and a writer living near Washington DC.
I work at GitHub, helping the Public Sector make better, more secure software.
Let's grab coffee.
This just started happening with our elstudio Action build recently, anyone have any ideas? This part of our action script then fails after the "Try running: npm install" message.
/usr/bin/docker run --name d9149604e427fb7a53a514a9d4b66_932784 --label 179394 --workdir /github/workspace --rm -e SLACK_CHANNEL -e SLACK_USERNAME -e SLACK_ICON -e SLACK_COLOR -e SLACK_WEBHOOK -e DOTNET_ROOT -e GITHUB_TOKEN -e INPUT_WDPATH -e INPUT_DEBUG -e DEBUG -e WD_PATH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/code/code":"/github/workspace" 179394:213d9149604e427fb7a53a514a9d4b66
Installing NPM dependencies
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN Invalid version: "-b2307d9e430e63bfb66f66cc967da4d09ebdeff6"
npm WARN workspace No description
npm WARN workspace No repository field.
npm WARN workspace No README data
npm WARN workspace No license field.
up to date in 0.349s
found 0 vulnerabilities
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
/usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp-cli/bin/gulp.js
+ [email protected]
added 246 packages from 165 contributors in 8.51s
Running Gulp with args
[05:13:25] Local modules not found in /github/workspace
[05:13:25] Try running: npm install
We've been using this build action for a while now to do some Gulp builds, and it's been working great. Recently we modified our Gulp file to use gulp-git, to help us generate a version number for our package.json, using info from git describe
and git rev-parse
. When we try to run this Gulpfile via this action, we get this error:
/bin/sh: git: not found
We get similar errors even if we explicitly install Git through another (earlier) step in our job, and then use const exec = require('child_process').exec
to allow us to run git commands directly.
Both of these work fine locally when we run Gulp. Any ideas for how to work around this issue, or why the Gulpfile cannot access git
from within an Action?
I'd like to be able to have the commit output amended to the commit that triggered it, and have it force push (only when there's something to commit, of course).
I'd also like to be able to configure it so that it only force pushes on "not master", for example (altho i can do that with conditional steps)
The documentation states:
Set the workflow
args
arguments to run the tasks of your choice.
But provides no example, could you add one?
Thanks!
So I'm using this workflow setup, the build works perfectly fine, but the commit step fails because I'm currently not on a branch
grunt-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Compile with Grunt
uses: elstudio/actions-js-build/build@v2
with:
args: 'build'
- name: Commit changes
uses: elstudio/actions-js-build/commit@v3
with:
commitMessage: Build Latest Version
This is the error I'm getting
Run elstudio/actions-js-build/commit@v3
with:
commitMessage: Build Latest Version
pushBranch: master
debug: false
/usr/bin/docker run --name bb105e3e0f5633074cb79ea55b1461123c70_d89e67 --label 54bb10 --workdir /github/workspace --rm -e INPUT_COMMITMESSAGE -e INPUT_PUSHBRANCH -e INPUT_WDPATH -e INPUT_DEBUG -e DEBUG -e WD_PATH -e COMMIT_MESSAGE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/gamesense-client/gamesense-client":"/github/workspace" 54bb10:5e3e0f5633074cb79ea55b1461123c70
Checking for uncommitted changes in the git working tree.
1
[detached HEAD bdcbbea] Build Latest Version
3 files changed, 174 insertions(+), 31 deletions(-)
rewrite dist/gamesense-client.min.js (98%)
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push origin HEAD:<name-of-remote-branch>
Is there a way to fix this?
Hey, thanks for these great actions! I'm using the commit action only and would love to be able to specify my own commit message so it makes more sense in the context I'm using it.
I'm trying to use this action to build a static site that then gets published to GitHub Pages. I'm using the variant where the site gets served from the docs
folder. But for some reason this doesn't work.
By this I mean the changes made by the automated build process get successfully pushed back into the repository. But these changes don't get deployed to gh-pages. On the other hand, the changes I make on and push from my local machine do get deployed.
Do you, by any chance, know why this is happening? Or is there a different approach that is known working?
Hello,
I'm only able to push already existing files back to the branch.
If i create a new file with a script, it's not being correctly added because
git diff --quiet
doesn't return anything.
How would you do to also add new files to the commit?
Tx
Im passing a specific tasks to run
- name: Compile with Grunt
uses: elstudio/actions-js-build/build@v4
with:
args: build
Doesn't work and I get this the output
Warning: Unexpected input(s) 'args', valid inputs are ['wdPath', 'debug']
I found it works with build@v2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.