I started using this action after conducting extensive research on how to push a signed commit (preferably signed by the GitHub bot) from an action.
My original stp was defined as follows:
- name: Update version
run: |
# Update package.json version
NEW_VERSION="${{ needs.determine-release.outputs.new-version }}"
npm version $NEW_VERSION --no-git-tag-version
# Commit version bump
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add package.json
git commit -m "chore: bump version to $NEW_VERSION"
git push
If that would work with my requirements, it would be great. However, I need signed commits, as my main branches require them.
After applying this action, I have to run three steps:
- name: Update version
run: |
# Update package.json version
NEW_VERSION="${{ needs.determine-release.outputs.new-version }}"
npm version $NEW_VERSION --no-git-tag-version
git add package.json
- uses: qoomon/actions--create-commit@v1
id: commit
with:
message: "chore: bump version to ${{ needs.determine-release.outputs.new-version }}"
skip-empty: true
- run: git push
It would be really nice to have a way to compress it to one or, at most, two steps. In such a case, I would run a step where I mutate repository files, and in the next step, I can either add all changed files or specific files, commit them, and then push to the upstream.
Ideally, my script would look something similar:
- name: Update version
run: |
# Update package.json version
NEW_VERSION="${{ needs.determine-release.outputs.new-version }}"
npm version $NEW_VERSION --no-git-tag-version
- uses: qoomon/actions--create-commit@v1
with:
message: "chore: bump version to ${{ needs.determine-release.outputs.new-version }}"
skip-empty: true
files: * # or the list of files.
push: true
I started using this action after conducting extensive research on how to push a signed commit (preferably signed by the GitHub bot) from an action.
My original stp was defined as follows:
If that would work with my requirements, it would be great. However, I need signed commits, as my main branches require them.
After applying this action, I have to run three steps:
It would be really nice to have a way to compress it to one or, at most, two steps. In such a case, I would run a step where I mutate repository files, and in the next step, I can either add all changed files or specific files, commit them, and then push to the upstream.
Ideally, my script would look something similar: