outer.yml: $GITHUB_OUTPUT (#2) #34
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
# outer.yml | |
name: Outer Workflow | |
on: | |
workflow_dispatch: | |
inputs: | |
test: | |
description: 'аываыва [Test names](https://docs.pytest.org/en/7.1.x/how-to/usage.html#specifying-which-tests-to-run)' | |
required: false | |
type: string | |
push: | |
branches: | |
- master | |
jobs: | |
pass-git-info: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get commit details | |
id: commit-details | |
run: | | |
commit_hash=$(git rev-parse HEAD) | |
commit_author=$(git log --format='%an' -n 1) | |
commit_merger=$(git log --format='%cn' -n 1) | |
commit_message=$(git log --format='%s' -n 1) | |
commit_description=$(git log --format='%B' -n 1) | |
echo "commit-hash=$commit_hash" >> "$GITHUB_OUTPUT" | |
echo "commit-author=$commit_author" >> "$GITHUB_OUTPUT" | |
echo "commit-merger=$commit_merger" >> "$GITHUB_OUTPUT" | |
echo "commit-message=$commit_message" >> "$GITHUB_OUTPUT" | |
echo "commit-description=$commit_description" >> "$GITHUB_OUTPUT" | |
# - name: Run nested workflow | |
# uses: ./.github/actions/inner | |
# 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 }} | |
- name: Print commit details | |
run: | | |
echo "Commit Hash: ${{ steps.commit-details.outputs.commit-hash }}" | |
echo "Commit Author: ${{ steps.commit-details.outputs.commit-author }}" | |
echo "Commit Merger: ${{ steps.commit-details.outputs.commit-merger }}" | |
echo "Commit Message: ${{ steps.commit-details.outputs.commit-message }}" | |
echo "Commit Description: ${{ steps.commit-details.outputs.commit-description }}" |