Add an optional "artifactSteps" category

005a065fd24cdf90fbf1e4d44df8672e9a929eba

Tucker McKnight | Sun Oct 12 2025

Add an optional "artifactSteps" category

This field in the config allows you to specify a list of build
steps. These build steps will run on every branch in the repo,
then copy a directory into the resulting _site directory for that
given branch.
main.ts:82
Before
82
After
82
          if (typeof repoConfig.artifactSteps !== 'undefined') {
            // make a temp directory for things to run in
            const tempDirName = `temp_${Math.floor(Math.random() * 10000).toString()}`
            const tempDir = `${directories.output}${reposPath}${tempDirName}`
            const tempDirRepoPath = `${tempDir}/${eleventyConfig.getFilter("slugify")(repoName)}`
            const mkdirresult = await exec(`mkdir ${tempDir}`)
            await exec(`git clone -s ${directories.output}${eleventyConfig.getFilter("slugify")(repoName)}.git ${tempDirRepoPath}`)
            Promise.all(repoConfig.branchesToPull.map(async (branch) => {
              await exec(`(cd ${tempDirRepoPath} && git checkout ${branch})`)
              return Promise.all(repoConfig.artifactSteps.map(async (artifactStep) => {
                // Run the command for each step in each branch
                await exec(`(cd ${tempDirRepoPath} && ${artifactStep.command})`)
                // Copy the specified folders from the "from" to the "to" dir
                return exec(`cp -r ${tempDirRepoPath}/${artifactStep.copyFrom} ${directories.output}${eleventyConfig.getFilter("slugify")(repoName)}/branches/${eleventyConfig.getFilter("slugify")(branch)}/${artifactStep.copyTo}`)
              }))
            })).then(async () => {
              // delete the temp dirs
              await exec(`rm -r ${tempDir}`)
            })
          }
schemas/ReposConfiguration.json:11
Before
11
After
11
        "artifactSteps": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "command": {
                "type": "string"
              },
              "copyFrom": {
                "type": "string"
              },
              "copyTo": {
                "type": "string"
              }
            },
            "required": [
              "command",
              "copyFrom",
              "copyTo"
            ],
            "type": "object"
          },
          "type": "array"
        },
schemas/ReposConfiguration.json:59
Before
59
After
59
        "artifactSteps": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "command": {
                "type": "string"
              },
              "copyFrom": {
                "type": "string"
              },
              "copyTo": {
                "type": "string"
              }
            },
            "required": [
              "command",
              "copyFrom",
              "copyTo"
            ],
            "type": "object"
          },
          "type": "array"
        },
src/configTypes.ts:71
Before
71
  }
After
71
  },
  artifactSteps?: {
      command: string,
      copyFrom: string,
      copyTo: string,
  }[]
src/configTypes.ts:153
Before
153
  }
After
153
  },
  artifactSteps?: {
      command: string,
      copyFrom: string,
      copyTo: string,
  }[]