{"_id":"@allejo/gha-workflows","_rev":"4-b8cf5294f4053f97b742c0830cce00dd","name":"@allejo/gha-workflows","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.0":{"name":"@allejo/gha-workflows","version":"0.0.0","author":{"name":"Vladimir \"allejo\" Jimenez"},"license":"MIT","_id":"@allejo/gha-workflows@0.0.0","maintainers":[{"name":"allejo","email":"me@allejo.io"}],"bin":{"gha-workflows":"dist/gha-workflows.js"},"dist":{"shasum":"33ab34063c132db7df29de52271118f726cb4d6b","tarball":"https://registry.npmjs.org/@allejo/gha-workflows/-/gha-workflows-0.0.0.tgz","fileCount":3,"integrity":"sha512-N566RZTCaS/6yKfPnB5EU6P8KEiENPzx1lhZfmVZ4GtQfbPr3kzWYw+9pBpIp9rQORS2MAEmAE9H/iKgWwBzSg==","signatures":[{"sig":"MEUCICCHhmg5DfDKKVoLVBELbloo479j2zkX/WQtyqjXD54/AiEA+kWePuuvGf0rg2CqZmquXKUBtRdmEK05HMhuqWH3D3A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdMfjCRA9TVsSAnZWagAAeYUP/Rl0UI/Oqcx51qHGbN+V\nptZ9ZX9piqTxO7C/0Ub9Y8e2HeBmkIqwpLqB+cNl4Gzs/wpzdkcnsGE62zuu\nWlyp122xsKBcaBgDEt1hVPMVs6w7D/13TLbnmNtTSvlqleSOBZ7T97GfC6wk\nHPoHFUy6MKfCsg56ng9dASZJXwECRz/9ACQpWRl5N0q8X+l5PAEF+3A/c5BE\nxrElGkHgiICuYVg6JdyuJjoNLq4GBzVi4+8swJN9SustUSfF2omw4ik2EJSx\nL9Sm/8/lJCozgbi2e4Q8xN5foI/Gwnk+bFMJBr+fnp4fKEetW0HvNmhsA5lS\nFGmMVBAkxQAzthXeeOrJcOYERROst9uDK9XfdGqg3HMYteiDqesnD/rhFVw3\nQAp2rFCzuTYjzkVNOKtdQIIfsxVWfnOeCPl0Yldijf3hVCHibiWgGCt7gFko\nfNexqeryZlq5J7dTk7T+Q4ne02Aev2wODlvWxkcdH62bkw8INmXcoz2XNO2d\n37S4lQk5QTzImUg7h9WdFR6iVBypvyu31PkucQlp5+PyvSzK3+CzThyGvx6/\n/wB/qUzOIYqp2ud7/FGEnHP45MADL86YQ5FqoTHLaoGzZgbvX9sXQwvSgbdM\nAruwdl91PYD1vycD7gG9IF45eqKdlal9Q/t/YRzbWFx3ZO2jcH5ycVkd+04+\nQMZA\r\n=SDVG\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"316434277d2c50176d4b68ed9d4be158f684a2b3","private":false,"scripts":{"compile":"babel bin -d dist","prepack":"npm run compile"},"_npmUser":{"name":"allejo","email":"me@allejo.io"},"_npmVersion":"6.14.6","description":"A super simple script to manage building Workflows for GitHub Actions","directories":{},"_nodeVersion":"12.18.3","dependencies":{"mkdirp":"^1.0.4","pkg-up":"^3.1.0","js-yaml":"^4.0.0","argparse":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"@babel/cli":"^7.13.14","@babel/core":"^7.13.15","@babel/preset-env":"^7.13.15"},"_npmOperationalInternal":{"tmp":"tmp/gha-workflows_0.0.0_1618266083324_0.06405843682532253","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.1":{"name":"@allejo/gha-workflows","version":"0.0.1","author":{"name":"Vladimir \"allejo\" Jimenez"},"license":"MIT","_id":"@allejo/gha-workflows@0.0.1","maintainers":[{"name":"allejo","email":"me@allejo.io"}],"bin":{"gha-workflows":"dist/gha-workflows.js"},"dist":{"shasum":"a090659050d382d6f0819734945093743d099c2c","tarball":"https://registry.npmjs.org/@allejo/gha-workflows/-/gha-workflows-0.0.1.tgz","fileCount":3,"integrity":"sha512-kRbNJFCwD6GaiIF3V4iVSPCuk24677+463cutZQDHeMw37aQcfy0CrmrYoO/PsRdO6GyGzs9QXcxOGxwPESuYw==","signatures":[{"sig":"MEQCIBYlxm2bIi3+X43BMr4rszUbYKCtmnx3Y6ydbFS+iaqPAiAYhbrwe4XP/AWOjPP3OuF3c6oUYAxYpfGJM0zIb1h1WA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggJ0MCRA9TVsSAnZWagAAXfsQAICPzLqLMr50/0nLKzOf\nzjrXQCh31Z818DUTSPwYhuu7qCI6b4w8NLClODCTjdRLsEnH6zg1gWM26b8W\nlXvmH6gqTTF+xwTPDGXfNOcRhDsbzHaH0R1YASe70rVc4U9Lx9RdUKQID1m3\ndXk8v3gkDn3z/gJWZx4sirTEJrG2w05QahQk6FVaJmDXd+lKl0jm4OA/667G\n0J2AU5eTOL+yTo/EipJrV5TBt5nTT5XgDLqhQeF+6E04dwhCrK7avK3eqbZK\nv7Komi44v1mNin+0v01Bp8VQngtQR0F8ffOrlWCaulGrzlaubVaKLcPYkk0N\nAf6B1KTnTi+ANVxqhhTmXgxM3zXZcOtP5mVS6CTDIXSgeRMcj/mFPz3tzx0Q\nzNXuyjtLTvhEfXfa6VWdG7cqGSZ0q709b83XOhXvSS1qK91s3BB8nOdRgR0g\nNIH8hkbjGcGq1TX6jOTlK8D4RG+Etvz5ZFPsVdzOgZSWHeLUByXKjWXd3cPO\nYee8lnjBsj+/t9xokX3pxFbCNCR676/m8WN9P6nIgmB+AM3GjOzj2Z6vjgH2\naIoqldADjVjh7sYXhH/xKB4RSUtT7eUTONeWf8szlKAlQ7GH7FrI0U2OIsMm\nE4N8QEMiY5jDXaWp9TWi+sEW5jVRbyANulQbAHIc6u0vw1l+3I8AsLOY5IqH\n99gP\r\n=WW1N\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"f364a22a9ed90be2b944126c5359211c828b2299","private":false,"scripts":{"compile":"babel bin -d dist","prepack":"npm run compile"},"_npmUser":{"name":"allejo","email":"me@allejo.io"},"_npmVersion":"6.14.6","description":"A super simple script to manage building Workflows for GitHub Actions","directories":{},"_nodeVersion":"12.18.3","dependencies":{"mkdirp":"^1.0.4","pkg-up":"^3.1.0","js-yaml":"^4.0.0","argparse":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"@babel/cli":"^7.13.14","@babel/core":"^7.13.15","@babel/preset-env":"^7.13.15"},"_npmOperationalInternal":{"tmp":"tmp/gha-workflows_0.0.1_1619041547543_0.8852797864395312","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2021-04-12T22:21:23.286Z","modified":"2026-01-04T23:28:21.713Z","0.0.0":"2021-04-12T22:21:23.483Z","0.0.1":"2021-04-21T21:45:47.651Z"},"author":{"name":"Vladimir \"allejo\" Jimenez"},"license":"MIT","description":"A super simple script to manage building Workflows for GitHub Actions","maintainers":[{"name":"allejo","email":"me@allejo.io"}],"readme":"# @allejo/gha-workflows\n\n[GitHub Actions does not support YAML anchors](https://github.community/t/support-for-yaml-anchors/16128) and it is incredibly annoying when it comes to reusing anything within those YAML files. So this is a stupid simple script that will expand YAML references and allow you to, *sigh*, compile your workflows.\n\nThis project was inspired by [mithro's `actions-includes`](https://github.com/mithro/actions-includes) project but it doesn't introduce any custom syntax. I also needed this in my JavaScript project pipelines and I did not want to setup Python just for that script.\n\nAt its core, this project is powered by [`js-yaml`](https://github.com/nodeca/js-yaml).\n\n## Example\n\n**Source YAML**\n\n```yaml\nname: Deployment\n\non:\n  push:\n    branches:\n      - master\n      - develop\n\njobs:\n  production:\n    name: Production Deployment\n    runs-on: ubuntu-latest\n    if: ${{ github.ref == 'refs/heads/master' }}\n    environment:\n      name: Production\n      url: https://example.com/product\n    steps: &production_steps\n      - uses: actions/checkout@v2\n\n  staging:\n    name: Staging Deployment\n    runs-on: ubuntu-latest\n    if: ${{ github.ref == 'refs/heads/develop' }}\n    environment:\n        name: Staging\n        url: https://staging.example.com/product\n\n    # Handled via the `gha-workflows` CLI since GHA doesn't support YAML anchors\n    #   see https://github.community/t/support-for-yaml-anchors/16128\n    steps: *production_steps\n```\n\n**Output YAML**\n\n```yaml\nname: Deployment\n'on':\n  push:\n    branches:\n      - master\n      - develop\njobs:\n  production:\n    name: Production Deployment\n    runs-on: ubuntu-latest\n    if: ${{ github.ref == 'refs/heads/master' }}\n    environment:\n      name: Production\n      url: https://example.com/product\n    steps:\n      - uses: actions/checkout@v2\n  staging:\n    name: Staging Deployment\n    runs-on: ubuntu-latest\n    if: ${{ github.ref == 'refs/heads/develop' }}\n    environment:\n        name: Staging\n        url: https://staging.example.com/product\n    steps:\n      - uses: actions/checkout@v2\n```\n\n## Installation\n\n### Use it Once\n\n```bash\nnpx @allejo/gha-workflows\n```\n\n### As a Dependency\n\n```bash\nnpm install --save-dev @allejo/gha-workflows\n# or\nyarn add --dev @allejo/gha-workflows\n```\n\n## CLI Usage\n\n```\nusage: gha-workflows.js [-h] [-v] [-c COMMENTS] [-s SOURCE] [-d DESTINATION]\n\nA super simple script to manage building Workflows for GitHub Actions\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -v, --version         show program's version number and exit\n  -c COMMENTS, --comments COMMENTS\n                        Add a header comment\n  -s SOURCE, --source SOURCE\n                        The source directory YAML files or single YAML file that will be \"compiled\"\n  -d DESTINATION, --destination DESTINATION\n                        The output directory where \"compiled\" YAML files will be written to\n\n```\n\n- The `SOURCE` will be the file or folder where the \"source\" YAML files (i.e. those with anchors and references) are located.\n- The `DESTINATION` file or folder will be where the compiled/flattened YAML file is written to. This should usually inside of `.github/workflows/`.\n- The `COMMENTS` value, which accepts `\\n`, will be comments added to the top of the outputted YAML files; useful for adding warnings not to edit a generated file.\n\n## Inside of `package.json`\n\nIn the spirit of JS stuffing literally everything into `package.json`, you can use the `gha-workflows` key to configure this utility.\n\n```javascript\n{\n  \"name\": \"my-simple-app\",\n  // ...\n  \"gha-workflows\": {\n    \"source\": \".github/workflows-src\",\n    \"destination\": \".github/workflows\",\n    \"comments\": [\n      \"DO NOT EDIT MANUALLY. THIS FILE IS AUTOMATICALLY GENERATED.\",\n      \"Edit the source files in `.github/workflows-src/`\"\n    ]\n  }\n}\n```\n\n- The `comments` key can be either a string with newlines, or an array of strings.\n","readmeFilename":"README.md"}