Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
copy

GitHub Action

Commit build artefacts

0.3.2 Pre-release

Commit build artefacts

copy

Commit build artefacts

Commit build artefacts to a build repository

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Commit build artefacts

uses: mutoco/commit-build-artefacts-action@0.3.2

Learn more about this action in mutoco/commit-build-artefacts-action

Choose a version

Commit build artefacts action

A GitHub Action to commit build artefacts to another repository.

Use case: You want to (continuously) hand over build artefacts to a third party. By using this action, you can push the contents of your build-process to a separate repository.

The build-repository will get generated automatically. Branches will be mirrored.

Word of advice: Only run this on push.

Inputs

source

Optional The build output directory, relative to the GITHUB_WORKSPACE. Default "build".

suffix

Optional The suffix for the build repository. Default "-build". So if your repository is named hello-world, the build repository will be hello-world-build.

organisation

Optional If the build-repo should belong to an organisation, set the organisation here. Otherwise, the repository will be created for your user.

Important: Your user (see Configuration) needs to have permissions to create repositories in that organisation

committer_name

Optional The user that will show up as the committer on the build repo. Defaults to "Anonymous"

committer_email

Optional The email that will be used for the committer on the build-repo. Is empty by default

Configuration

The following environment variables must be set in order for this script to run.

API_ACCESS_TOKEN

Required Provide an API token with permissions to create a repository. Instructions on creating a personal access token.

Make sure to tick the repo permission group.

API_USERNAME

Required Set the username that belongs to the access token.

Example usage

Please make sure to use the actions/checkout@v2 beforehand. You'd also need some action that creates your build artefacts (unless you just want to just export a specific folder to the build repo).

name: Deploy
on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0 # get history for commit messages
      - uses: # some action that creates a build
      - uses: actions/commit-build-artefacts-action@latest
        with:
          source: 'compiled'
          organisation: example
          committer_name: Build-Tools
          committer_email: email@example.com
        env:
          API_USERNAME: username
          API_ACCESS_TOKEN: ${{ secrets.MY_PAT }}

TODO

-[ ] Check if authenticated requests can be made by just using the checkout action

Inspired by HV-Publish