You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code reuse across workflows is impossible, we're copy-pasting across repositories and this isn't ok. I don't know when/if GitHub will allow workflow reuse like with GitHub Actions: actions/runner#748
Is this something that can be done in userland? For example:
# .github/workflows-template/test.ymlapply:
name: fregante/gh-workflow-npm-test@hash124with: # If `gh-workflow-npm-test` has any custom/conditional features, `with` acts as parametersnode-version: [8.x, 10.x, 12.x]jobs:
test:
env:
MY-COOL-ENV: an amazing project
or
jobs:
test:
name: Let's test stuffapply: fregante/gh-workflow-npm-test@hash124#jobs.test # It would only merge the specific jobs.test sectionbuild:
needs: teststeps:
- run: echo My other steps
Then, on npm install or some other event, this module will:
look files under .github/workflows-template/*.yml
download the specified workflows from GitHub
merge the user's template with the specified workflow(s), applying any special variables it expects like node-version
save the merged workflow as .github/workflows/$1.yml
This is pretty simple, but I need your suggestions on when/how to ensure that .github/workflows/$1.yml is up to date:
via postinstall only?
git hooks?
The text was updated successfully, but these errors were encountered:
I imagined it first of all configuration-free so, given a repo with a source template, you'll be able to pull it in with no further local configuration. You can just run this in your repository now:
npx ghat fregante/ghat/templates/node
It would copy the workflow(s) from the fregante/ghat repo in the templates/node folder and apply a header with instructions.
To update it in the future, you just re-run the same command and commit the changes, if you like them.
This does away with any versioning/installation needs, because workflows can't change automatically.
fregante
changed the title
Enable reuse of GitHub Actions workflows somehow
Enable reuse of GitHub Actions workflows somehow (completed 💚)
Nov 10, 2020
Code reuse across workflows is impossible, we're copy-pasting across repositories and this isn't ok. I don't know when/if GitHub will allow workflow reuse like with GitHub Actions: actions/runner#748
Is this something that can be done in userland? For example:
or
Then, on
npm install
or some other event, this module will:.github/workflows-template/*.yml
node-version
.github/workflows/$1.yml
This is pretty simple, but I need your suggestions on when/how to ensure that
.github/workflows/$1.yml
is up to date:postinstall
only?The text was updated successfully, but these errors were encountered: