Remote Trigger Workflow #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 GitHub Actions / Remote Trigger WorkflowInvalid workflow file
|
||
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 }} |