Skip to content

GitHub Action Xcode Cloud

Actions

About

Trigger Xcode Cloud Workflows via GitHub Actions
v0.1.2
Latest
Star (3)

GitHub Action Xcode Cloud

A GitHub Action that triggers Xcode Cloud workflows from your CI/CD pipeline. This action allows you to start Xcode Cloud builds programmatically using the App Store Connect API.

Features

  • Trigger Xcode Cloud workflows from GitHub Actions from any Git branch
  • Outputs build information for further processing

Usage

Basic Example

name: Trigger Xcode Cloud Buildon:
push:
branches: [main]jobs:
trigger-build:
runs-on: ubuntu-lateststeps:
- name: Trigger Xcode Cloudid: xcode-clouduses: inventas/github-action-xcode-cloud@v1with:
keyId: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}key: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}issuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} # Leave out for Individual App Store Connect API KeysxcodeCloudWorkflowId: ${{ secrets.XCODE_CLOUD_WORKFLOW_ID }}gitBranchName: main
- name: Print build inforun: | echo "Build Number: ${{ steps.xcode-cloud.outputs.buildNumber }}" echo "Build ID: ${{ steps.xcode-cloud.outputs.buildId }}" echo "Git Reference ID: ${{ steps.xcode-cloud.outputs.gitReferenceId }}"

Conditional Trigger

- name: Trigger Xcode Cloud on releaseif: startsWith(github.ref, 'refs/tags/')uses: inventas/github-action-xcode-cloud@v1with:
keyId: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}key: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}issuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} # Leave out for Individual App Store Connect API KeysxcodeCloudWorkflowId: ${{ secrets.XCODE_CLOUD_WORKFLOW_ID }}gitBranchName: ${{ github.ref_name }}

Inputs

InputDescriptionRequiredExample
keyIdApp Store Connect API Key IDABC1234DEF
keyApp Store Connect Private Key (P8)-----BEGIN PRIVATE KEY-----\n...
issuerIdApp Store Connect Issuer ID (Leave out for Individual App Store Connect API Keys)12345678-1234-1234-1234-123456789012
xcodeCloudWorkflowIdXcode Cloud Workflow ID12345678-1234-1234-1234-123456789012
gitBranchNameGit branch name to trigger build onmain, develop, feature/new-feature

Outputs

OutputDescriptionExample
buildNumberThe build number assigned by Xcode Cloud42
buildIdThe unique build ID12345678-1234-1234-1234-123456789012
gitReferenceIdThe Git reference ID used for the build87654321-4321-4321-4321-210987654321

How to Obtain Required Inputs

1. App Store Connect API Credentials

You need to create an App Store Connect API key with appropriate permissions:

  1. Sign in to App Store Connect

  2. Create API Key

    • Navigate to Users and Access > Integrations > App Store Connect API
    • Click Generate API Key
    • Enter a name for your key (e.g., "GitHub Actions Xcode Cloud")
    • Select role: Developer (minimum required)
    • Click Generate
  3. Download and Store Credentials

    • Key ID: Copy the Key ID (e.g., ABC1234DEF)
    • Issuer ID: Copy the Issuer ID (UUID format). Leave out for Individual App Store Connect API Keys.
    • Private Key: Download the .p8 file and copy its contents
    • Important: Store these securely as GitHub secrets immediately

2. Xcode Cloud Workflow ID

  1. Open App Store Connect

    • Navigate to your app
    • Go to Xcode Cloud tab
  2. Find Workflow ID

    • Click on the workflow you want to trigger
    • Look at the URL in your browser:
      https://appstoreconnect.apple.com/teams/{team-id}/apps/{app-id}/ci/workflows/{workflow-id}
      
    • Copy the {workflow-id} part (UUID format)

3. Setting Up GitHub Secrets

Add these secrets to your GitHub repository:

  1. Go to your repository → SettingsSecrets and variablesActions
  2. Click New repository secret and add:
    • APP_STORE_CONNECT_KEY_ID: Your Key ID
    • APP_STORE_CONNECT_ISSUER_ID: Your Issuer ID
    • APP_STORE_CONNECT_PRIVATE_KEY: Your private key content (including -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY-----)
    • XCODE_CLOUD_WORKFLOW_ID: Your workflow ID

Requirements

  • Your repository must be connected to Xcode Cloud
  • The specified branch must exist in your repository
  • App Store Connect API key must have appropriate permissions
  • Xcode Cloud workflow must be properly configured

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Development

Building the Action

This action uses @vercel/ncc to bundle the Node.js application and dependencies into a single file.

Prerequisites

  • Node.js (version 24 or later)
  • npm

Setup

  1. Clone the repository
  2. Install dependencies:
    npm install

Building

To build the action after making changes:

npm run build

This creates a bundled file at dist/index.js which includes all dependencies.

Important Notes

  • The dist/ folder must be committed to the repository for GitHub Actions to work
  • Always run npm run build after making code changes
  • The bundled dist/index.js file is what GitHub Actions actually executes

Credits

This action builds upon work from yorifuji/actions-xcode-cloud-dispatcher licensed under the MIT License.

GitHub Action Xcode Cloud is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Trigger Xcode Cloud Workflows via GitHub Actions
v0.1.2
Latest

GitHub Action Xcode Cloud is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.