Skip to content

mutoco/commit-build-artefacts-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published