-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Inner Workflow | ||
|
||
on: | ||
workflow_run: | ||
|
||
jobs: | ||
print-inputs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Print commit details | ||
run: | | ||
echo "Commit Hash: ${{ github.event.inputs.commit-hash }}" | ||
echo "Commit Author: ${{ github.event.inputs.commit-author }}" | ||
echo "Commit Merger: ${{ github.event.inputs.commit-merger }}" | ||
echo "Commit Message: ${{ github.event.inputs.commit-message }}" | ||
echo "Commit Description: ${{ github.event.inputs.commit-description }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Outer Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
pass-git-info: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
- name: Get commit details | ||
id: commit-details | ||
run: | | ||
echo "::set-output name=commit-hash::${{ github.sha }}" | ||
echo "::set-output name=commit-author::${{ github.event.pull_request.user.login }}" | ||
echo "::set-output name=commit-merger::${{ github.event.pull_request.merged_by.login }}" | ||
echo "::set-output name=commit-message::${{ github.event.head_commit.message }}" | ||
echo "::set-output name=commit-description::${{ github.event.head_commit.message }}" | ||
- name: Run nested workflow | ||
uses: ./.github/workflows/inner.yml | ||
with: | ||
commit-hash: ${{ steps.commit-details.outputs.commit-hash }} | ||
commit-author: ${{ steps.commit-details.outputs.commit-author }} | ||
commit-merger: ${{ steps.commit-details.outputs.commit-merger }} | ||
commit-message: ${{ steps.commit-details.outputs.commit-message }} | ||
commit-description: ${{ steps.commit-details.outputs.commit-description }} |