Import a workflow from GitHub
This guide shows how to import a workflow definition directly from a GitHub repository and how to re-import it when the source file changes.
Prerequisites
- The GitHub account or organization that owns the repository is connected on your own account, and the Swale GitHub App's installation on it covers the repository. Importing into an organization's project also goes through your own connection; see GitHub integration and Connect and manage GitHub integration.
- A verified email. In an organization, every member who can open the project can import, Contributors included.
Import a workflow from GitHub
- Open the project in the UI and go to its Workflows page.
- Click Add Workflow → Import from GitHub.
- Select the connected GitHub owner: the GitHub account or organization the repository belongs to.
- Select the repository. The list shows the repositories the app's installation covers that your GitHub user can access.
- Browse to and select the YAML workflow file. To read it from another branch or ref, enter it in Branch or ref and click Load.
- Click Import.
The workflow is created in the project using the selected file's content.
Re-import a workflow
When the source file in GitHub is updated, you can re-import it to refresh the workflow definition:
With the CLI (re-import without a local file):
swale workflow update \
--project-name my-project \
--workflow-id <workflow-id>
Running workflow update without the --file flag pulls the latest version of the file from its GitHub source through the connection of whoever runs it. The owner the workflow was imported from must be connected on that person's account, and its app installation must still cover the repository.
A workflow uploaded from a file, or last updated with --file, has no GitHub source to pull from, so the command refuses it. Update such a workflow with --file instead.
The platform UI has no re-import control; use the CLI command above. Get the workflow's ID from swale workflow list --project-name my-project.
Troubleshooting
- If the repository or file you want is not listed, see Repository not visible.
- Importing needs a verified email; see Permissions and restrictions.
- In an organization, you can import only into projects you can open: a Contributor reaches only the projects of their teams.
- If importing fails for every owner, connect GitHub again.