Github action - AB Tasty action

Custom github action to utilize resource management in the github workflow

We only support Feature Experimentation (For now)

This repository contains a custom GitHub Action designed to create and manage
your AB Tasty resources for feature experimentation and web experimentation products such as projects, campaigns, teams, etc... You can use these commands to perform common AB Tasty platform actions from your terminal or through scripts and other automation.

Our Github Action is built on top of our CLI, enabling you to use resource
loader to batch your processes.

For example, you can use the AB Tasty Action to manage :

Feature experimentation: Projects, campaigns, flags, targeting keys, goals,
etc...

Features

Usage

Prerequisites

Make sure you have the following set up before using this action:

  • A GitHub repository
  • Necessary permissions or secrets added to your repository

Basic Example

Add the following to your workflow YAML file (e.g.,
.github/workflows/your-workflow.yml):

name: Load resource to Feature experimentation workflow

on:
  push:
    branches:
      - main

jobs:
  load-resources:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Run Your Action
        uses: flagship-io/[email protected]
        with:
          fe-login-auth: |
            commandId: c1
            username: configuration-name
            client-id: ${{secrets.CLIENT_ID}}
            client-secret: ${{secrets.CLIENT_SECRET}}
            account-id: ${{secrets.ACCOUNT_ID}}
            account-environment-id: ${{secrets.ACCOUNT_ENVIRONMENT_ID}}

          fe-load-resource: |
            commandId: c2
            file: resource-loader-templates/file-example.json
            input-params-file: resource-loader-templates/input-params-file-example.json
            output-format: json

Inputs

Input NameRequiredDefault ValueDescription
fe-login-authYesN/AFeature experimentation: Login & authenticate
fe-load-resourceNoN/AFeature experimentation: Load resources from your file
fe-list-flagNoN/AFeature experimentation: List flags
fe-list-campaignNoN/AFeature experimentation: List campaigns
fe-list-projectNoN/AFeature experimentation: List projects
fe-list-goal:NoN/AFeature experimentation: List goals
fe-list-tkNoN/AFeature experimentation: List targeting keys
fe-list-vgNoN/AFeature experimentation: List variation groups
fe-list-variationNoN/AFeature experimentation: List variations

Outputs

Output NameDescription
commandsResultResult of CLI flow

Secrets

If your action requires secrets, add them to your repository under Settings >
Secrets and variables > Actions
.

Secret NameDescription
CLIENT_IDClient ID
CLIENT_SECRETClient Secret
ACCOUNT_IDAccount ID
ACCOUNT_ENVIRONMENT_IDAccount environment ID

Example Scenarios

Example 1: List project

steps:
  - name: List Project
    uses: flagship-io/[email protected]
    with:
      fe-login-auth: |
        commandId: c1
        username: configuration-name
        client-id: ${{secrets.CLIENT_ID}}
        client-secret: ${{secrets.CLIENT_SECRET}}
        account-id: ${{secrets.ACCOUNT_ID}}
        account-environment-id: ${{secrets.ACCOUNT_ENVIRONMENT_ID}}

      fe-list-project: |
        commandId: c2

Example 2: Load resources

steps:
  - name: Load resources
    uses: flagship-io/[email protected]
    with:
      fe-login-auth: |
        commandId: c1
        username: configuration-name
        client-id: ${{secrets.CLIENT_ID}}
        client-secret: ${{secrets.CLIENT_SECRET}}
        account-id: ${{secrets.ACCOUNT_ID}}
        account-environment-id: ${{secrets.ACCOUNT_ENVIRONMENT_ID}}

      fe-load-resource: |
        commandId: c2
        file: resource-loader-templates/file-example.json
        input-params-file: resource-loader-templates/input-params-file-example.json
        output-format: json

Development

Testing Locally

  1. Clone this repository:
    git clone https://github.com/flagship-io/abtasty-action.git
  2. Make your changes and commit them.
  3. Test the action locally using act or a
    similar tool.

Building the Action

If your action uses a compiled language or requires packaging:

npm install && npm run build

If you set up act:

make act

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Submit a pull request.

License

This project is licensed under the MIT License.


Acknowledgments


For questions or support, open an issue or contact [email protected].