Skip to content

Commit

Permalink
DO NOT LAND
Browse files Browse the repository at this point in the history
Copy actions from daos-stack/daos.

These need to be published and commonly available.

Skip-PR-comments: true
Run-GHA: true

Required-githooks: true

Signed-off-by: Brian J. Murrell <[email protected]>
  • Loading branch information
brianjmurrell committed Apr 16, 2024
1 parent 206df77 commit e65371a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/actions/import-commit-pragmas/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Import Commit Pragmas'
description: 'Import Commit Pragmas'
runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: . ci/gha_functions.sh;
git show -s --format=%B | sed -e "s/'/'\"'\"'/g" |
get_commit_pragmas |
sed -e 's/^/CP_/' >> $GITHUB_ENV
shell: bash
28 changes: 28 additions & 0 deletions .github/actions/variable-from-pragma/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Set Variable from Commit Pragma'
description: 'Set Variable from Commit Pragma'
inputs:
commit_message:
description: Dequoted commit message
required: true
pragma:
description: Pragma to make a variable from
required: true
default:
description: Default value if pragma is not found
required: false
outputs:
value:
description: The value of the pragma
value: ${{ steps.value.outputs.value }}

runs:
using: "composite"
steps:
- name: Create Variable
id: value
shell: bash
run: |
. ci/gha_functions.sh
set -eu
eval $(echo '${{ inputs.commit_message }}' | get_commit_pragmas)
echo "value=${${{ inputs.pragma }}:-${{ inputs.default }}}" >> $GITHUB_OUTPUT
6 changes: 3 additions & 3 deletions .github/workflows/rpm-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ jobs:
steps:
- name: Set rpm-test-version variable
id: rpm-test-version
uses: daos-stack/daos/variable-from-pragma
uses: ./.github/actions/variable-from-pragma
with:
commit_message: ${{ needs.Import-commit-message.outputs.dequoted_message }}
pragma: RPM_TEST_VERSION
- name: Set pr-repos variable
id: pr-repos
uses: daos-stack/daos/variable-from-pragma
uses: ./.github/actions/variable-from-pragma
with:
commit_message: ${{ needs.Import-commit-message.outputs.dequoted_message }}
pragma: PR_REPOS
- name: Set run-gha variable
id: run-gha
uses: daos-stack/daos/variable-from-pragma
uses: ./.github/actions/variable-from-pragma
with:
commit_message: ${{ needs.Import-commit-message.outputs.dequoted_message }}
pragma: RUN_GHA
Expand Down

0 comments on commit e65371a

Please sign in to comment.