Include action url in commit message #333
-
It would be super useful to include the url to the summary page of the current action in the commit message so you could more easily jump to the log. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Sorry only saw this discussion today. You're suggesting that the commit message created by git-auto-commit automatically adds a link to the "run"-page where the commit has been created from, to the commit body, right? So instead of a commit log that would look like this:
It would look like this:
I think this is not something I would like to add to the action itself. I currently can't see the benefit of adding this to all commits made with this action. However, you're able to do this yourself by reading the I haven't tested this exact workflow, but this is how you could add a link to the workflow run to the body of your commit. # Building a multiline commit message
# Adjust to your liking
- run: echo "Apply automatic changes" >> commitmessage.txt
- run: echo "https://github.com/your-org/your-repo/actions/runs/$GITHUB_RUN_ID" >> commitmessage.txt
# Create a multiline string to be used by the git-auto-commit Action
- name: Set commit message
id: commit_message_step
run: |
echo 'commit_message<<EOF' >> $GITHUB_OUTPUT
cat commitmessage.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
# Quick and dirty step to get rid of the temporary file holding the commit message
- run: rm -rf commitmessage.txt
- uses: stefanzweifel/git-auto-commit-action@v5
id: commit
with:
commit_message: ${{ steps.commit_message_step.outputs.commit_message }} |
Beta Was this translation helpful? Give feedback.
-
Thanks for the detailed reply, it's much appreciated. Just to make sure I'm not missing something obvious, how do you do from a automated commit to the log of the action that generated it? Is there some existing UI that makes my request less useful? |
Beta Was this translation helpful? Give feedback.
Sorry only saw this discussion today.
You're suggesting that the commit message created by git-auto-commit automatically adds a link to the "run"-page where the commit has been created from, to the commit body, right?
So instead of a commit log that would look like this:
It would look like this: