Skip to content

Remote Trigger Workflow #21

Remote Trigger Workflow

Remote Trigger Workflow #21

name: Remote Trigger Workflow
on:
workflow_dispatch:
inputs:
message:
description: 'Message from the remote repo'
required: true
default: 'Hello from remote'
data:
description: 'Additional data'
required: false
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
timestamp: ${{ steps.set-timestamp.outputs.timestamp }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set timestamp
id: set-timestamp
run: |
TIMESTAMP=$(date +%Y%m%d%H%M%S)
echo "timestamp=$TIMESTAMP" >> $GITHUB_OUTPUT
- name: Create draft branch
run: |
git checkout -b build-draft-${{ steps.set-timestamp.outputs.timestamp }}
git push origin build-draft-${{ steps.set-timestamp.outputs.timestamp }}
test:
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
job: [test-all-packages, integration]
steps:
- name: Run ${{ matrix.job }}
uses: ./.github/workflows/${{ matrix.job }}.yml

Check failure on line 42 in .github/workflows/test-workflow-dispatch.yml

View workflow run for this annotation

GitHub Actions / Remote Trigger Workflow

Invalid workflow file

The workflow is not valid. .github/workflows/test-workflow-dispatch.yml (Line: 42, Col: 15): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.job
with:
ref: build-draft-${{ needs.prepare.outputs.timestamp }}
create-release-branch:
needs: [prepare, test]
if: success()
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create release branch
run: |
git checkout -b build-release-${{ needs.prepare.outputs.timestamp }}
git push origin build-release-${{ needs.prepare.outputs.timestamp }}
- name: Delete draft branch
run: |
git push origin --delete build-draft-${{ needs.prepare.outputs.timestamp }}