Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ A collection of reusable GitHub Actions and Workflows for Shopware extensions an

| Action | Description | Link |
|--------|-------------|------|
| [saas-preview-environment](saas-preview-environment/) | Creates, migrates or archives a SaaS Preview Environment | [README](saas-preview-environment/README.md) |
| [saas-preview-environment](saas-preview-environment/) | Creates or archives a SaaS Preview Environment | [README](saas-preview-environment/README.md) |
| [update-saas-refs](update-saas-refs/) | Triggers an update of SAAS upstream refs for a given branch | [README](update-saas-refs/README.md) |

### Notifications

Expand Down
12 changes: 6 additions & 6 deletions downstream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Trigger a downstream workflow in another repository and wait for it to finish.
|-------|-------------|----------|---------|
| `repo` | Downstream repo | Yes | - |
| `token-scope` | Scope for the sts token | No | - |
| `workflow` | Workflow to dispatch in downstream | Yes | - |
| `workflow` | Workflow filename to dispatch in downstream (including `.yml` / `.yaml` suffix) | Yes | - |
| `ref` | Downstream ref (`.auto` to auto-detect matching refs) | No | `.auto` |
| `refFallback` | Fallback ref in case there's no matching branch | No | `trunk` |
| `env` | Environment variables to pass to downstream workflow | No | - |
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: shopware/github-actions/downstream@main
with:
repo: my-org/my-repo
workflow: test
workflow: test.yml
ref: trunk
```

Expand All @@ -62,7 +62,7 @@ jobs:
- uses: shopware/github-actions/downstream@main
with:
repo: my-org/my-repo
workflow: test
workflow: test.yml
ref: .auto
refFallback: trunk
```
Expand All @@ -77,7 +77,7 @@ jobs:
- uses: shopware/github-actions/downstream@main
with:
repo: my-org/my-repo
workflow: test
workflow: test.yml
env: |
PLATFORM_BRANCH=trunk
FOO=bar
Expand All @@ -93,7 +93,7 @@ jobs:
- uses: shopware/github-actions/downstream@main
with:
repo: my-org/my-repo
workflow: test
workflow: test.yml
timeout: 60m
poll_interval: 1m
```
Expand All @@ -108,7 +108,7 @@ jobs:
- uses: shopware/github-actions/downstream@main
with:
repo: my-org/my-repo
workflow: test
workflow: test.yml
token: ${{ secrets.CUSTOM_TOKEN }}
```

Expand Down
6 changes: 3 additions & 3 deletions downstream/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Downstream workflow"
description: "Trigger a downstream worflow in another repository"
description: "Trigger a downstream workflow in another repository"
author: "shopware AG"
branding:
color: "blue"
Expand All @@ -10,10 +10,10 @@ inputs:
description: "Downstream repo"
required: true
token-scope:
description: "Scrope for the sts token"
description: "Scope for the sts token"
required: false
workflow:
description: "Workflow to dispatch in downstream"
description: "Workflow filename to dispatch in downstream (including .yml / .yaml suffix)"
required: true
ref:
description: "Downstream ref, automatically detects matching refs with .auto"
Expand Down
2 changes: 1 addition & 1 deletion saas-preview-environment/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SaaS Preview Environment

Create, migrate or archive a SaaS Preview Environment.
Create or archive a SaaS Preview Environment.

## What it does

Expand Down
2 changes: 1 addition & 1 deletion saas-preview-environment/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: SaaS Preview Environment
description: "Create, migrate or archive a SaaS Preview Environment"
description: "Create or archive a SaaS Preview Environment"
author: "shopware AG"
branding:
color: "blue"
Expand Down
4 changes: 2 additions & 2 deletions shopware-version/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gets the Shopware version that matches the current branch.
| `ref` | The git reference to match (defaults to `github.ref`) | No | - |
| `base-ref` | The base reference for pull requests (defaults to `github.base_ref`) | No | - |
| `head-ref` | The head reference for pull requests (defaults to `github.head_ref`) | No | - |
| `shopware-github-token` | Token used for checking out the shopware repository | No | - |
| `github-token` | GitHub token used to authenticate gh API calls | No | `${{ github.token }}` |

## Outputs

Expand Down Expand Up @@ -51,7 +51,7 @@ Gets the Shopware version that matches the current branch.
with:
repo: my-org/shopware
fallback: trunk
shopware-github-token: ${{ secrets.SHOPWARE_TOKEN }}
github-token: ${{ secrets.SHOPWARE_TOKEN }}
```

### Using the output
Expand Down
5 changes: 3 additions & 2 deletions update-saas-refs/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Update SAAS Refs Action

Action to create a PR with updated SAAS refs for a given branch.
Action to trigger an update of SAAS upstream refs for a given branch.

## What it does

1. Checks if the target branch exists in the saas repository
2. create a PR to update the upstream refs in the target branch to the latest commit
2. Triggers the `core-update.yml` workflow in `shopware/saas` to update upstream refs on that branch

## Inputs

| Input | Description | Required | Default |
|-----------------|--------------------------------------|----------|---------|
| `pull_request` | The pull request that triggered the update | Yes | `${{ github.event.pull_request }}` |
| `target-branch` | target branch in the saas repository | No | `${{ github.base_ref }}` |

## Usage
Expand Down
29 changes: 17 additions & 12 deletions upstream-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Connects to upstream from downstream run.
## What it does

1. Receives upstream data from a triggered workflow
2. Sets environment variables from the upstream run
3. Displays information about the upstream workflow that triggered the run
2. Displays information about the upstream workflow that triggered the run
3. Sets custom environment variables passed from the upstream run

## Inputs

Expand Down Expand Up @@ -37,15 +37,17 @@ jobs:

### Accessing upstream data

After using this action, the following environment variables are available:
This action logs the upstream workflow run URL when `upstream_data` contains upstream metadata.

- `upstream.id`: The run ID of the upstream workflow
- `upstream.ref`: The ref of the upstream workflow
- `upstream.repo`: The repository of the upstream workflow
- `upstream.github-token`: The GitHub token from upstream
- `upstream.url`: URL to the upstream workflow run
Custom environment variables passed from upstream via the `env` input of the downstream action are written to `$GITHUB_ENV` and become available to later steps.

Any custom environment variables passed from upstream via the `env` input of the downstream action will also be set.
Upstream metadata (`id`, `ref`, `repo`, `url`, etc.) stays inside the JSON `upstream_data` input. Access it with `fromJSON`, for example:

```yaml
- run: |
echo "Triggered by: ${{ fromJSON(inputs.upstream_data).upstream.repo }}"
echo "Run URL: ${{ fromJSON(inputs.upstream_data).upstream.url }}"
```

## Example: Combined with downstream action

Expand All @@ -58,8 +60,11 @@ jobs:
- uses: shopware/github-actions/downstream@main
with:
repo: my-org/my-repo
workflow: test
workflow: test.yml
ref: trunk
env: |
PLATFORM_BRANCH=trunk
FOO=bar
```

**Downstream workflow:**
Expand All @@ -78,6 +83,6 @@ jobs:
with:
upstream_data: ${{ inputs.upstream_data }}
- run: |
echo "Triggered by: ${{ env.upstream.repo }}"
echo "Run URL: ${{ env.upstream.url }}"
echo "Custom env from upstream: $PLATFORM_BRANCH $FOO"
echo "Upstream run URL: ${{ fromJSON(inputs.upstream_data).upstream.url }}"
```
1 change: 1 addition & 0 deletions versions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Gets the first and latest versions of the current and previous (LTS) major versi
|-------|-------------|----------|---------|
| `major` | Current major prefix (e.g., `v6.7.`) | No | `v6.7.` |
| `lts-major` | LTS major prefix (e.g., `v6.6.`) | No | `v6.6.` |
| `github-token` | Token used to check for release branches via the GitHub API | No | `${{ github.token }}` |

## Outputs

Expand Down
Loading