Automattic / Automattic/action-commit-to-branch

How to execute bash command in commit_message

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
17
Forks
20
PR merge metrics
No merged PRs in 30d

Description

@dereksmart
I want my commit message to contain a bash script to get a value from a file, is it doable?

Something like this
```yaml
- name: Push to staging branch
uses: Automattic/action-commit-to-branch@master
with:
branch: 'staging'
commit_message: ${ echo "Increase version to $(sed -rn 's/^version=([^\n]+)$/\1/p' file.properties)"}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting how the action reads the commit_message input and constructs the commit, then reproduce the example with file.properties in a test workflow. Done means a bash command can provide the value in the generated commit message, with the expected wording verified in the workflow output.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, github-actions, shell
Domain
ci-cd, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.