# Resource actions as code

> Synchronize resource actions with a remote source code repository

---

Site [llms.txt](/llms.txt)

---

Once a resource action is linked to a repository, you can push it, preview the changes, and later refresh the action from the repository. You can also create an action from one already in a repository. This requires a repository linked to Cloud Management Platform (CMP) and repository credentials on your profile so commits are attributed to you. See [Integrate a remote source code repository](/docs/cmp/configure/integrations/source-code-repository/).

## Push and refresh a resource action

Open the action from **Admin** > **Resource Actions**, then select its repository tab. The tab is named **Repository** until the action is linked to a repository; then it is named **GitHub** or **GitLab**.

**Push to Remote Source** opens a form for a **Repository**, **Branch**, and **Commit Message**. If the action has been pushed before, select **Preview** first to see what changed. After the push, the result includes a link to open a pull request.

**Refresh from Remote Source** prompts for a **Repository** and **Branch**, then updates the action in CMP based on the repository's contents. It appears once the action has been pushed or created from a repository, and the tab also shows the repository, the remote source URL, and when the action was last refreshed.

A resource action that uses a [custom form](/docs/cmp/configure/order-forms-and-pricing/custom-forms/) includes that form; pushing the action also writes the form and any functions it uses to the repository.

<div class="alert alert-info" role="alert">


An action that came from a repository is read-only unless **Remote Content Mode** in [Miscellaneous Settings](/docs/cmp/configure/administration/system/miscellaneous-settings/) allows editing. While it is read-only, **Push to Remote Source** is disabled.
</div>


## Create a resource action from a repository

1. Go to **Admin** > **Resource Actions**.
2. Select **Create from Repository**.
3. Provide a **Repository**, **Branch**, and **Resource Action JSON File**.
4. Optionally select **Ignore Action Enable** to create the action disabled and ignore later changes to its enabled state.
5. Select **Save**.

## Related

- [Integrate a remote source code repository](/docs/cmp/configure/integrations/source-code-repository/): Linking a repository and setting credentials for your commits.
- [Resource actions](/docs/cmp/use/orchestration/actions/resource-actions/): Building the actions that appear as buttons on a resource.
